/metry

Primary LanguageTypeScript

MetryApiClient

This is a minimalist ApiClient to MetryApi

Supported operations:

  • getMeters: retrieves a list of meters with their consumption information.
  • getConsumption: retrieves consumption data for a single meter

Developed With

This program is developed on top of:

Getting Started

Follow the below steps to setup it up on your own machine.

Prerequisites

You need npm and node installed on your computer to run this program.

  • install node using this link
  • npm
    npm install npm@latest -g

Installation

  1. You need a valid Metry Api token to use this ApiClient. check out Metry Api docs on how you can get one.

  2. Clone the repo

    git clone https://github.com/fardinhakimi/metry.git
  3. Install NPM packages

    npm install
  4. Create a .env file in the root of the project

    touch .env
  5. Enter your METRY_API_URL and METRY_API_TOKEN in .env

    METRY_API_URL= '<METRY_API_URL>'
    METRY_API_TOKEN= '<METRY_API_TOKEN>'
  6. build the project (optional)

     npm run build
  7. run the example

    npm run test:run

Usage

Look in src/index.ts for an example of how to use the client.

Contact

Fardin Hakimi - fardinhakimi@gmail.com