Installation
Add the Auther backend SDK to your Node.js server to verify end-user tokens on every request.
Supported runtimes
Node.js ≥ 18
PythonSoon
GoSoon
RubySoon
PHPSoon
RustSoon
Install
bash
npm install @auther-sdk/nodeInitialise
Create one Auther instance per project and export it. endpoint defaults to the Auther production API. Set it explicitly to point at a local or self-hosted backend; it is never switched automatically based on your environment.
typescript
import { Auther } from '@auther-sdk/node';
export const auther = new Auther({
clientId: process.env.AUTHER_CLIENT_ID!,
clientSecret: process.env.AUTHER_CLIENT_SECRET!,
// Optional. Defaults to the Auther production API.
// endpoint: 'http://localhost:4000',
// Optional. Max wait for a verification request before failing
// with 504, so a slow backend cannot hang your request. Default 5000.
// timeoutMs: 5000,
});Environment variables
Store your credentials in environment variables - never hardcode secrets.
bash
# .env
AUTHER_CLIENT_ID=req_live_xxxxxxxxxxxxxxxx
AUTHER_CLIENT_SECRET=sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxZero dependencies
The SDK uses Node's built-in
https module. No extra runtime packages required.