The Logto Express SDK written in TypeScript.
Check out our docs for more information.
npm install @logto/expressyarn add @logto/expresspnpm add @logto/expressUse signInOptions for defaults shared by every sign-in. Add getSignInOptions when an
individual request needs to override them:
import { handleAuthRoutes, Prompt } from '@logto/express';
app.use(
handleAuthRoutes(
{
...config,
signInOptions: { prompt: Prompt.Login },
},
{
getSignInOptions: (request, flow) => {
const prompt = request.query.prompt;
return flow === 'signIn' && prompt === 'consent' ? { prompt: Prompt.Consent } : {};
},
}
)
);Resolver values override signInOptions. The SDK manages callback redirect fields and forces the
registration screen for the sign-up route. Validate or allowlist request input before copying it
into sign-in options.