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

x/deno_nest/modules/jwt/src/jwt.utils.ts>generateToken

Refer to nestjs to realize some common functions for Deno, support hono and oak
Latest
function generateToken
import { generateToken } from "https://deno.land/x/deno_nest@v3.15.1/modules/jwt/src/jwt.utils.ts";

Generate JWT

Parameters

payload: Payload

The data to be added to the JWT

The key used to sign the JWT

optional
options: SignOptions

The expiration time of the JWT in seconds

Returns

Promise<string>

The generated JWT string