Node
TypeScript@identrahq/nodeVerify access tokens locally (EdDSA via cached JWKS) and call the API with your secret key.
Install
pnpm add @identrahq/nodeVerify a token
ts
import { IdentraServer } from "@identrahq/node";
const identra = new IdentraServer({
baseUrl: "https://api.identrahq.com",
applicationId: process.env.IDENTRA_APP_ID!,
apiKey: process.env.IDENTRA_API_KEY, // optional; only for API calls
});
// In your auth middleware:
const claims = await identra.verifyToken(req.headers.authorization ?? "");
// claims.sub (user), claims.sid (session), claims.aal, claims.org, claims.org_roleManagement calls
Provide `apiKey` to call the management API server-side. `verifyToken` throws `IdentraError("unauthorized")` on an invalid or wrong-tenant token.
ts
const user = await identra.createUser({ primary_email: "a@b.com" });API
IdentraSerververifyToken()createUser()IdentraError