Installation
Install the SDK using npm or yarn:Quick Start
Key Features
Automatic Token Refresh
The SDK automatically validates and refreshes JWT tokens when they expire, ensuring seamless user sessions.Secure Cookie Management
Store authentication material in secure, HttpOnly cookies with customizable options for maximum security.Framework Agnostic
Works with any server-side JavaScript framework including Next.js, Express, Fastify, and more.User Management
Retrieve user information and manage authentication state across your application.Core Classes and Methods
CrossmintAuth
The main class for handling authentication operations:getSession()- Retrieve and validate user sessionslogout()- Clear authentication statehandleCustomRefresh()- Handle token refresh requestsgetUser()- Retrieve user information by external user IDverifyCrossmintJwt()- Verify JWT tokens
CrossmintAuthServer.ts:30
Next Steps
Authentication
Learn how to authenticate users and manage sessions
Session Management
Handle session validation and token refresh
Custom Refresh Routes
Set up custom refresh routes for enhanced security