This project is a sample of how to use the Palmetto Energy and Finance API in TypeScript. The goal of this project is to quickly bootstrap a developer with the following:
- How to programmatically generate a Typescript library to make calling Palmetto APIs simple and easy.
- How to setup authentication for Palmetto APIs
- How to call and get the response from some of the key APIs
In order to get started and make your first succesfull API calls you will need to do the following:
- Clone this repo (or chose
Use this template
to start a new repo from it)
- Run
npm install
to install all the packages - Run
npm run generate
to generate the Palmetto Energy and Finance client SDKs - Create a .env file in the root of the project and add the following variables:
PALMETTO_ENERGY_ACCOUNT_EMAIL=YOUR_SERVICE_ACCOUNT_EMAIL@DOMAIN.COM
PALMETTO_ENERGY_ACCOUNT_PASSWORD=YOUR_SERVICE_ACCOUNT_PASSWORD
PALMETTO_FINANCE_ACCOUNT_EMAIL=YOUR_SERVICE_ACCOUNT_EMAIL@DOMAIN.COM
PALMETTO_FINANCE_ACCOUNT_PASSWORD=YOUR_SERVICE_ACCOUNT_PASSWORD
There is a sample .env file called .env.example
that you can rename to .env
and put your values in. If you use the same account for both Palmetto Finance and Palmetto Energy you can use the same email and password for both.
- Run the samples by running
npm run start
The examples shown in the sample are not meant to be exhaustive but a good starting point. For more information please refer to https://docs.palmetto.com