Package Exports
- @cityssm/green-button-subscriber
- @cityssm/green-button-subscriber/index
- @cityssm/green-button-subscriber/index.js
Readme
Green Button® Subscriber for Node
Handles the OAuth authentication, downloading, and parsing of Green Button® data.
Important Notes
This code is for use with the Green Button Connect My Data® (CMD) standard. Before it can be used with your utility company, you may have to undergo a registration and approval process with that utility company to be formerly registered as a third party solution provider.
❗ Due to the extensive registration process and the need to be a customer with the utility company to access data, this module is currently only tested with UtilityAPI's Green Button® CMD implementation.
If you are looking to parse Green Button® XML data downloaded from a utility provider using the Green Button Download My Data® (DMD) standard, see the City of Sault Ste. Marie's Green Button® Parser.
Installation
npm install @cityssm/green-button-subscriberUsage
⭐ All output is parsed and returned as a fully typed object. ⭐
import * as greenButtonSubscriber from '@cityssm/green-button-subscriber'
// Pass the base URL, client ID, client secret, etc.
greenButtonSubscriber.setConfiguration(config)
// Get the authorizations
const greenButtonJson = await greenButtonSubscriber.getAuthorizations()Trademarks
® GREEN BUTTON is a registered trademark owned by Departments of the U.S. Government.