https://github.com/cityssm/node-green-button-subscriber
Handles the OAuth authentication, downloading, and parsing of Green Button® API data.
https://github.com/cityssm/node-green-button-subscriber
connect-my-data energy-consumption energy-usage espi green-button openespi utilityapi xml-parser
Last synced: 9 months ago
JSON representation
Handles the OAuth authentication, downloading, and parsing of Green Button® API data.
- Host: GitHub
- URL: https://github.com/cityssm/node-green-button-subscriber
- Owner: cityssm
- License: mit
- Created: 2023-08-01T17:25:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T07:14:23.000Z (over 2 years ago)
- Last Synced: 2025-06-03T13:52:41.659Z (about 1 year ago)
- Topics: connect-my-data, energy-consumption, energy-usage, espi, green-button, openespi, utilityapi, xml-parser
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@cityssm/green-button-subscriber
- Size: 271 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Green Button® Subscriber for Node
[](https://www.npmjs.com/package/@cityssm/green-button-subscriber)
[](https://app.deepsource.com/gh/cityssm/node-green-button-subscriber/?ref=repository-badge)
[](https://codeclimate.com/github/cityssm/node-green-button-subscriber/maintainability)
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](https://www.greenbuttonalliance.org/green-button-connect-my-data-cmd).
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](https://utilityapi.com/docs/greenbutton)._
## Installation
```bash
npm install @cityssm/green-button-subscriber
```
## Usage
⭐ All output is parsed and returned as a fully typed object. ⭐
```javascript
import { GreenButtonSubscriber } from '@cityssm/green-button-subscriber'
const configuration = {
baseUrl: 'https://greenbutton.example.com/',
accessToken: '0123456789abcdef'
}
// Pass the base URL, client ID, client secret, etc.
const greenButtonSubscriber = new GreenButtonSubscriber(configuration)
// Get the authorizations
const greenButtonResponse = await greenButtonSubscriber.getAuthorizations()
```
## Related Projects
If you are looking to parse Green Button® XML data downloaded from a utility provider
using the [Green Button Download My Data® (DMD) standard](https://www.greenbuttonalliance.org/green-button-download-my-data-dmd), see the
[City of Sault Ste. Marie's Green Button® Parser](https://github.com/cityssm/node-green-button-parser).
If you are looking for a full application to report on energy usage,
see [EMILE (Energy Monitoring in Less Effort)](https://github.com/cityssm/EMILE).
## Trademarks
® GREEN BUTTON is a registered trademark owned by Departments of the U.S. Government.
The City of Sault Ste. Marie is a [Liaison member of the Green Button Alliance](https://www.greenbuttonalliance.org/members/sault-ste-marie).