Node
TypeScript@identra/nodeVerify access tokens locally (EdDSA via cached JWKS) and call the API with your secret key.
Install
pnpm add @identra/nodeVerify a token
ts
import { IdentraServer } from "@identra/node";
const identra = new IdentraServer({
baseUrl: "http://localhost:8080",
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: "[email protected]" });API
IdentraSerververifyToken()createUser()IdentraError