Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jose/jwt/sign.ts>SignJWT#sign

JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Latest
method SignJWT.prototype.sign
import { SignJWT } from "https://deno.land/x/jose@v5.9.6/jwt/sign.ts";

Signs and returns the JWT.

Parameters

key: KeyLike | Uint8Array | JWK

Private Key or Secret to sign the JWT with. See Algorithm Key Requirements.

optional
options: SignOptions

JWT Sign options.

Returns

Promise<string>