tesla-vehicles-api

A node module for Tesla Vehicles API in Typescript

Usage no npm install needed!

<script type="module">
  import teslaVehiclesApi from 'https://cdn.skypack.dev/tesla-vehicles-api';
</script>

README

Tesla-Vehicles-Api

A Node module for the Tesla Vehicle Owners API in Typescript.

npm version Build Status

Documentation


Prerequisites

  • Node 10+

Installation

Install the dependencies and devDependencies and start the server.

$ npm install --save tesla-vehicles-api

Usage

  import {client} from 'tesla-vehicles-api'; or  const CLIENT = require('tesla-vehicles-api').client;

  let _client = new CLIENT||client({
    username: 'jonsnow@kingofthenorth.got',
    password: 'I<3Ghost'
  });

  // let _client = new CLIENT||client({
  //   access_token: '123456789123456789',
  //   refresh_token: 'asdasdasdasdasdasd'
  // });

  _client.getToken().then(result => console.log(result)).catch(err => console.error(err));
  
  // Skip this if you already have the token

Enums Usage

  import * as TeslaEnum from 'tesla-vehicles-api/dist/types' or   const TESLA_ENUM = require('tesla-vehicles-api/dist/types');

Development

Want to contribute? Great! Make a Pr! Open your favorite Terminal and run these commands.

Building for source

To release in javascript. The output is dumped in the dist folder:

$ npm run build

Testing

  • Uses Jest, Supertest, Chai - Integration Tests needed

    npm test
    

Changelog

Link

License

Apache-2.0

Author

Peter A. Tariche