The TeslaJS library currently supports all existing Tesla vehicles and Tesla Solar.
With the introduction of the new OAuth-based owner API, one of the features I wanted was the ability to make API calls without having to login each time a new process was invoked. Many existing libraries require a login transaction with each initiation of the library. With the TeslaJS library, once an auth token is retrieved it can be cached and used to make other Tesla API calls. For certain use cases, notably server logging of multiple vehicles, this can be important for moderating load on the Tesla login servers.
This is also important if you want to use the library to do server-based data logging. It is generally safer to store an OAuth token on the server rather than logon credentials. If the server is compromised only the OAuth token is at risk and all existing tokens can be invalidated by changing the password on the account.
Another feature that I wanted was API stateless-ness (achieved via an options parameter to API calls) so that it was possible to use the library to make multiple overlapping async calls to different vehicles for data-logging.
This project has a few principles that have and will continue to guide its development.
Contributions are welcome, particularly bug fixes and enhancements! Refer to our Contribution Guidelines for details.
Please note that the Project owners reserve the right to accept or reject any PR for any reason.
Code of Conduct
Before contributing or participating in the TeslaJS community please be sure to familiarize yourself with our project CODE OF CONDUCT. These guidelines are intended to govern interactions with and within the TeslaJS community.
Tesla API Documentation
The Tesla API encapsulated by this library was documented through the collaboration of many Tesla owners. Please thank and support them for their continued efforts! The latest API documentation can be found here.
You may use this library with the understanding that doing so is AT YOUR OWN RISK. No warranty, express or implied, is made with regards to the fitness or safety of this code for any purpose. If you use this library to query or change settings of your vehicle you understand that it is possible to make changes that could inadvertently lower the security of your vehicle, or cause damage, through actions including but not limited to: