This is a minimalist ApiClient to MetryApi
- getMeters: retrieves a list of meters with their consumption information.
- getConsumption: retrieves consumption data for a single meter
This program is developed on top of:
Follow the below steps to setup it up on your own machine.
You need npm and node installed on your computer to run this program.
- install node using this link
- npm
npm install npm@latest -g
-
You need a valid Metry Api token to use this ApiClient. check out Metry Api docs on how you can get one.
-
Clone the repo
git clone https://github.com/fardinhakimi/metry.git
-
Install NPM packages
npm install
-
Create a .env file in the root of the project
touch .env
-
Enter your METRY_API_URL and METRY_API_TOKEN in
.env
METRY_API_URL= '<METRY_API_URL>' METRY_API_TOKEN= '<METRY_API_TOKEN>'
-
build the project (optional)
npm run build
-
run the example
npm run test:run
Look in src/index.ts for an example of how to use the client.
Fardin Hakimi - fardinhakimi@gmail.com