Skip to main content

Express

Official

Middleware to protect Express routes and APIs with ThunderID.

API reference

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

Middleware
Client
Configuration
Constants
middlewareThunderID Middleware

The

thunderID() function returns Express middleware that initializes a ThunderIDExpressClient and attaches it to both req.thunderIDAuth and res.thunderIDAuth.

Example
const express = require('express');
const cookieParser = require('cookie-parser');
const {thunderID, handleSignIn, handleSignOut} = require('@thunderid/express');

const app = express();

app.use(cookieParser());
app.use(express.json());
app.use(
  thunderID({
    baseUrl: 'https://localhost:8090',
    clientId: '<your-client-id>',
    clientSecret: '<your-client-secret>',
  }),
);

app.get('/login', handleSignIn());
app.get('/logout', handleSignOut());

Get started

Provider, session, and a protected route, start to finish.

Connect your application

Getting started / Connect your application / Express

Open in docs

The quickstart is maintained alongside the rest of the getting-started guides so it stays in step with the platform. This page covers the package itself.

Guides

Task-focused walkthroughs maintained alongside the SDK.

Embedded Sign-In

Drive the Express embedded sign-in flow with handleFlow() for JSON-based multi-step authentication.

3 min read

Redirect Flow

Build the standard Express sign-in and protected-route flow using redirect-based OAuth 2.0 PKCE.

3 min read
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.