/rest-streaming

REST Streaming API sample app for Nest Cam, Thermostat and Protect using Node.js

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Nest REST Streaming API Sample

Sample app showcasing Nest's REST Streaming API using Node.js

Screenshot

Screenshot

Install

Install the dependencies from npm:

npm install

Log in to https://developer.nest.com/products

Create a client using the following permissions:

  • Away read v2
  • Camera read v2
  • Camera read + images v2*
  • Smoke+CO alarm read v4
  • Thermostat read v4

*Note: Images are only available with a Nest Aware subscription.

Set your client redirect URI to be http://localhost:3000/auth/nest/callback

Set up your Nest credentials in your environment variables:

export NEST_ID=XXX
export NEST_SECRET=XXX

Start

Start the server:

npm start

Open your browser to http://localhost:3000

Server Only Mode

By default the app runs in a server-client mode with a browser UI. You can also run the app in server-only mode (still requires a browser for initial OAuth2 flow).

Start in server-only mode:

npm run server-only

The events will then be logged to the node console rather than displayed in a browser UI.

Contributing

We love contributions! 😄 Please follow the steps in CONTRIBUTING to get started. If you found a bug, please file it here.

License

Licensed under the Apache 2.0 license. See LICENSE for details.