This is an example project that uses the ring-client-api
npm package to access the Ring API from Node.js. It is intended to show a basic project structure with proper TypeScript configuration.
- (Optional) Fork this repository if you want to push changes to your own copy
- Clone the repository to your local environment
- Run
npm i
(assuming you already have Node.js installed)
- Run
npm run auth
to start the process. It should prompt you for email/password/token - You will see a refresh token output like
"refreshToken": "eyJhbGciOi...afa1"
. You need to extract the value from the second part of this output, between the double quotes. - Create a
.env
file in the root directory of this project and insert the following contents, replacing value with the one you got from the auth command above. Make sure you don't include the quotes:
RING_REFRESH_TOKEN=eyJhbGciOi...afa1
The example can be found in the example.ts file. Once you have followed the Authentication steps, you can start it by running npm start
Additional examples of how to use the ring-client-api
can be found in https://github.com/dgreif/ring/tree/main/packages/examples