Skip to main content

Module: jwt

This module contains functions and types to encode and decode JWTs issued and used by Auth.js.

The JWT issued by Auth.js is encrypted by default, using the A256GCM algorithm (JWE). It uses the AUTH_SECRET environment variable to dervice a sufficient encryption key.

Note

Auth.js JWTs are meant to be used by the same app that issued them. If you need JWT authentication for your third-party API, you should rely on your Identity Provider instead.

Installation​

npm install @auth/core

You can then import this submodule from @auth/core/jwt.

Usage​

Warning

This module will be refactored/changed. We do not recommend relying on it right now.

Resources​

Functions​

Interfaces​