Skip to content

rewiringamerica/ra-api-rem-ts-node

Repository files navigation

@rewiringamerica/rem

An API for REM, the Residential Electrification Model. The other Rewiring America APIs and methodology for REM are here.

This Typescript package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.0
  • Package version: 0.3.0
  • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.TypeScriptNodeClientCodegen

For more information, please visit https://www.rewiringamerica.org/

Requirements.

Typescript ^4.0 or ^5.0

Installation & Usage

npm

Run:

npm install @rewiringamerica/rem

Then import the package:

import rem from '@rewiringamerica/rem';

yarn

Run:

yarn add @rewiringamerica/rem

Getting Started

Please follow the installation procedure and then run the following:

import { ResidentialElectrificationModelApi } from "@rewiringamerica/rem/api/apis";
import { SupportedUpgrade } from "@rewiringamerica/rem/model/supportedUpgrade";
import { HeatingFuelInput } from "@rewiringamerica/rem/model/heatingFuelInput";
import { HttpBearerAuth } from "@rewiringamerica/rem/model/models";

// Initialize the client and key
const key = new HttpBearerAuth()
key.accessToken = "key_example"

const rem_api = new ResidentialElectrificationModelApi();
rem_api.setDefaultAuthentication(key)

// Get savings by address
async function getRemByAddress(upgrade: SupportedUpgrade, address: string, heatingFuel: HeatingFuelInput) {
  try {
    const response = await rem_api.getByAddress(upgrade, address, heatingFuel);

    console.log(response.body);
  } catch (error) {
    console.error("Error:", error.response.body);
  }
}

// Call the async function
const address = "address_example"
getRemByAddress(SupportedUpgrade.BasicEnclosure, address, HeatingFuelInput.NaturalGas);

Documentation For Authorization

Sign up for an API key here.

Authentication schemes defined for the API:

auth

  • Type: Bearer authentication

Author

[email protected]

About

Typescript client stubs for the REM API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published