OAuth Providers
Logo for xeroXero
Obtain access tokens to Xero accounts with Handshake.

How it works

With your instance deployed, redirect users to:

https://YOUR_HANDSHAKE_INSTANCE_URL/auth/HANDLER_ID/redirect

Where HANDLER_ID is either xero or the value passed to the optional id argument of the Xero() factory. (See Options below.)

Handshake will take each user through the Xero OAuth flow and before sending them back to you, at the URL specified by the callback_uri query parameter.


Options

Modify your app/options.ts file to include the Xero() handler like so:

app/options.ts
 
import { Xero } from "handshake";
 
Xero({
 clientId: process.env.XERO_CLIENT_ID,
 clientSecret: process.env.XERO_CLIENT_SECRET,
 scopes: ["offline_access", "accounting.transactions"],
});

The offline_access scope is required to get a refresh_token in your response.

Consult the reference to learn about HandshakeOptions.


Troubleshooting

You may see an "Error: invalid_scope : Invalid scope" error if the only scope you provide is offline_access .

"Invalid scope" error

"Invalid scope" error


Facing an issue not included here? Open an issue on GitHub to get help.