Xero NodeJS OAuth 2.0 App
This NodeJS project demonstrates how to use the xero-node SDK.
Note: this project was built using Visual Studio Code and NodeJS v10.
How to use
Configure with your credentials
Create an OAuth 2.0 app in Xero to get a XERO_CLIENT_ID and XERO_CLIENT_SECRET.
- Create a free Xero user account (if you don't have one)
- Login to Xero Developer center https://developer.xero.com/myapps
- Click "Try OAuth 2.0"
- Enter your app details (your redirect URI is http://localhost:5000)
- Click "Create App"
- Copy your client id and redirect URI into
const client_id = '_YOUR_CLIENT_ID'; const redirectUrl = 'http://localhost:5000/callback';
- Click "Generate a secret"
- Copy your secret into
const client_secret = '_YOUR_CLIENT_SECRET'
Build and run
npm install npm run prod