Tiny tool to quickly (and locally) generate a Tesla-API OAuth token.
npm install generate-tesla-tokengenerate-tesla-token
====================
This is a tiny, one-off module to generate [Tesla API][API] tokens (necessary if you don't want to
give your username and password out to random Internet services) locally, i.e. if you're properly
paranoid, and don't want to trust websites that say they “don't store the information, and only use
it to generate a token.”
Hopefully, with the immanent release of the Model 3, Tesla will get off their collective asses and
offer a proper OAuth authentication (and crucially, revocation) flow, with granular permissions ...
until then, be careful with this. **Any token you generate with this can be used to unlock, locate,
start your car!**
Here's a couple sites for which this is useful (i.e. ones that allow you to directly enter a token,
manually):
-
- The [My Tesla][] skill for [Amazon Alexa and Echo devices][Alexa]
[Alexa]:
"The Amazon Echo intelligent home-control speaker"
[My Tesla]:
"Nikhil Kapur's unofficial ‘My Tesla’ Alexa skill"
Usage
-----
You'll [need Node and npm][tutorial] installed, first.
You can install this Node package the traditional way, if you really want it sitting around on your
computer and getting out-of-date ...
npm install -g generate-tesla-token
Or, if you have a recent version of npm, it's much simpler to use [npx][npx] (you can get it by
upgrading npm with npm install -g npm, or install directly with npm install -g npx):
npx generate-tesla-token
src="https://user-images.githubusercontent.com/200/28244480-e69b65e6-69b1-11e7-9cc8-be027d87f84c.png">
[tutorial]:
"npm's instructions for installing Node.js on your computer"
[npx]: