Step 5: Verify JWT on the server
⏱ 10 minAfter sign-in, the SDK holds a JWT (aud: transcodes-sdk). Send it to your API as Authorization: Bearer <token> and verify locally with ES256 — no round-trip to Transcodes per request.
Client
const token = await transcodes.token.getAccessToken();
await fetch('/api/me', {
headers: { Authorization: `Bearer ${token}` },
});Server
- Download public key (JWK) from Console → Authentication cluster → JSON Web Key.
- Verify with ES256 (not RS256). See JSON Web Key.
import { importJWK, jwtVerify } from 'jose';
const publicKey = await importJWK(TRANSCODES_PUBLIC_JWK, 'ES256');
const { payload } = await jwtVerify(token, publicKey);
// payload.sub = member id, aud must be transcodes-sdkRegenerating JWK in Console invalidates old keys — update your server copy.
Framework examples: Next.js · React
Next: Bonus: Member console
Last updated on