Skip to main content
Go to Latest
function jwtSign
import { jwtSign } from "https://deno.land/x/darkflare@v5.0.0/jwt/mod.ts";

Signs a payload and returns the token

Parameters

payload: JwtPayload

The payload object. To use nbf (Not Before) and/or exp (Expiration Time) add nbf and/or exp to the payload.

secret: string

A string which is used to sign the payload.

optional
options: JwtSignOptions | JwtAlgorithm = [UNSUPPORTED]

The options object or the algorithm.

Returns

Promise<string>

Returns token as a string.