Encapsulates functionality of the jsonwebtoken package.

Constructors

Methods

Constructors

Methods

  • Asynchronously sign the given payload into a JSON Web Token string payload.

    Parameters

    • payload: string | object | Buffer<ArrayBufferLike>

      Any info that should be put inside the token.

    • secret: Secret

      The secret used to encrypt the token.

    • Optionaloptions: SignOptions

      Additional options like "expiresIn".

    Returns Promise<string>

    A promise of the jwt.