@useoneid/node
v1.0.0
Published
Official Node.js & Edge SDK for UseOneID RS256 JWT Token Verification & Identity Gateway
Maintainers
Readme
@useoneid/node
Official Node.js & Edge SDK for verifying UseOneID RS256 JWT Identity tokens against the UseOneID Edge JWKS.
Installation
npm install @useoneid/nodeQuick Start (Next.js App Router / Express)
// app/api/auth/useoneid/route.ts
import { NextRequest, NextResponse } from "next/server";
import { verifyUseOneIDToken } from "@useoneid/node";
export async function POST(req: NextRequest) {
const { token } = await req.json();
const verification = await verifyUseOneIDToken(token, {
expectedAudience: process.env.USEONEID_CLIENT_ID,
});
if (!verification.valid) {
return NextResponse.json({ error: "Unauthorized token" }, { status: 401 });
}
// Identity is 100% verified against official government registries
const { sub, email, full_name, kyc_tier, picture } = verification.claims;
return NextResponse.json({
success: true,
user: { id: sub, email, name: full_name, tier: kyc_tier, avatar: picture },
});
}Features
- Stateless RS256 JWKS Verification: Zero roundtrip latency, verified locally at the edge.
- Automatic Sandbox Bypass: Seamless instant testing during development.
- Universal Runtime: Works in Node.js 18+, Next.js (Edge & Node runtime), Deno, Cloudflare Workers, and Bun.
License
MIT © UseOneID
