A node.js app to demonstrate the use of the Automatic Webook API. It shows driving events, such as ignition on, for the logged in user in real time on a map.
A version of this application is available at https://automaticator.herokuapp.com.
One-Click deploy to Heroku
After deploying, you will need to use the Automatic Developer Apps Manager to set your application's redirect URL and webhook URL to match the Heroku app name you selected when deploying. For instance, if you name your app
automaticator-test in Heroku your redirect URL should be
https://automaticator-test.herokuapp.com/redirect and your webhook URL should be
https://automaticator-test.herokuapp.com/webhook. Note that the URLs must start with
Install node and gulp
brew install node npm install gulp -g
Install required packages from NPM and Bower:
This will also grab frontend packages needed from bower and put them in
Configure your client id and client secret
Copy the file
config.json and add your Automatic client id and client secret. Alternatively, create environment variables named
Get a mapbox access token and add it to the
Run the app
View the app
localhost:3000 in your browser.
Testing locally, skipping OAuth
You can test locally as a logged in user, bypassing OAuth by including an
USER_ID when running the app.
USER_ID=<YOUR_USER_ID> TOKEN=<YOUR-AUTOMATIC-ACCESS-TOKEN> gulp develop
If you have the heroku toolbelt installed, you can create, configure and deploy this app to Heroku. To create an app:
If you already created an app, add it as a git remote:
git remote add heroku YOUR-HEROKU-GIT-URL
Configure the heroku app's environment variables:
heroku config:add AUTOMATIC_ACCOUNTS_URL=https://accounts.automatic.com heroku config:add AUTOMATIC_CLIENT_ID=<YOUR AUTOMATIC CLIENT ID> heroku config:add AUTOMATIC_CLIENT_SECRET=<YOUR AUTOMATIC CLIENT SECRET> heroku config:add SESSION_SECRET=<YOUR SESSION SECRET>
Deploy your app to heroku:
git push heroku master
See deploying a node.js app for more information.
Please write to firstname.lastname@example.org if you have any questions or need help.
This project is licensed under the terms of the Apache 2.0 license.