Prerequisites
- Staging project: Create a project in the Crossmint staging Console.
- Client-side API key: Create a key with the
users.create,users.read, andwallets.readscopes. In staging, all scopes are included by default. - Server-side API key: For the server examples, use a key with the
users.readscope.
When to Use Crossmint Auth
Use Crossmint Auth for staging, demos, and prototypes. It supports email OTP, social sign-in with Google, Apple, or X, Farcaster, and external wallets. React web includes a login modal. React Native and Flutter use headless flows.Setup
- React
- React Native
- Flutter
Install the React SDK:Add
CrossmintProvider and CrossmintAuthProvider to your app. Use useCrossmintAuth() to sign in and out.Providers.tsx
AuthButton.tsx
Check That It Works
Start the React app, sign in, and confirm that your email appears.Login Methods
SetloginMethods on CrossmintAuthProvider to choose which methods appear. Email and Google are enabled by default.
Providers.tsx
"web3:evm-only" or "web3:solana-only" to limit external wallet types.
Customize the Login Modal
SetauthModalTitle, termsOfServiceText, and appearance on CrossmintAuthProvider to customize the login modal.
Read the User Profile
UseuseCrossmintAuth().user to read the signed-in user’s profile:
Verify Sessions on Your Server
Install@crossmint/server-sdk and create CrossmintAuth with a server-side API key that has the users.read scope. Use getSession to validate or refresh a session. Use verifyCrossmintJwt to verify a JWT:
session-route.ts
Protect Session Tokens
By default, client-side JavaScript can access Crossmint Auth tokens. You can set secure cookie options for the refresh token. The session JWT remains available to client-side JavaScript because the client SDK needs it for API calls. Add refresh and logout routes to your server. The server stores the refresh token in anhttpOnly cookie:
server.ts
CrossmintAuthProvider to these routes:
Providers.tsx
User Webhooks
Crossmint sends theusers.created event when a user signs up with Crossmint Auth. The id field identifies the user. The email and phoneNumber fields appear when the user signs up with the matching method.

