Skip to main content
Module

x/cav/jwt.ts>encodeJwt

A server framework for Deno
Go to Latest
function encodeJwt
import { encodeJwt } from "https://deno.land/x/cav@0.2.0-alpha.7/jwt.ts";

Creates a new JWT with the given payload, which is passed into JSON.stringify before encoding. If no key is specified, a securely random transient fallback will be used. The fallback key is only generated once during startup and it's lost when the Deno process quits.

If multiple keys are specified, only the first key will be used.

JWT header: { "alg": "HS256" }

Parameters

payload: unknown
optional
keys = [UNSUPPORTED]

Returns

Promise<string>