Crossmint Auth on Flutter is headless — there is no pre-built login modal.
You build your own UI and call the SDK directly. This guide walks through both
email OTP and OAuth login flows. Optional pre-built widgets are available
via
crossmint_flutter_ui.dart.Before you start
Set up your project and get an API key.
Flutter Wallets Example
See a full working example with auth and wallets.
Install the SDK
Install the Crossmint Flutter SDK:The SDK bundles the following dependencies:
| Package | Purpose |
|---|---|
flutter_secure_storage | Encrypted token storage (Keychain on iOS, Keystore on Android) |
url_launcher | Opens the OAuth consent screen in a system browser |
app_links | Listens for OAuth deep-link redirects back to your app |
Configure your deep link scheme
OAuth redirects require a deep link scheme so the browser can return to your app after login.Android — add to your iOS — add to your Pass the same scheme to
AndroidManifest.xml:android/app/src/main/AndroidManifest.xml
Info.plist:ios/Runner/Info.plist
CrossmintClientConfig.appScheme.Initialize the client
Initialize Pass the API key via
CrossmintClient and restore any persisted session on app launch.lib/crossmint.dart
main.dart
--dart-define when running the app:Build the login screen
Use the
CrossmintAuthClient to implement email OTP and OAuth login flows.Email OTP Login
login_screen.dart
OAuth Login (Google, Twitter)
oauth_button.dart
How OAuth Works on Android vs iOS
How OAuth Works on Android vs iOS
The SDK handles platform differences automatically via
CrossmintAuthCallbackRouter:- iOS: Uses
url_launcherto open an in-app authentication session. The redirect URL is captured by the auth callback router viaapp_links. - Android: Opens the system browser. The OAuth provider redirects back to your app via the
deep link scheme configured in
AndroidManifest.xml.
CrossmintAuthCallbackRouter listens for incoming deep links on both platforms and automatically
completes the OAuth flow — no manual URL handling required.Auth State Values
TheCrossmintAuthState provides the following status information:
| Status | Description |
|---|---|
initializing | The SDK is loading stored tokens and checking session validity |
loggedOut | No active session. Show your login screen |
inProgress | An OAuth or OTP flow is currently in progress |
loggedIn | The user is authenticated. user and jwt are available |
Token Storage
By default, the SDK stores authentication tokens usingflutter_secure_storage, which encrypts data
at rest using the platform keychain (iOS) or keystore (Android). Tokens persist across app restarts
and are protected by the device’s hardware-backed security.
You can provide a custom storage implementation via CrossmintClientConfig.authStorage if you need
a different storage backend. The SDK also provides InMemoryCrossmintAuthStorage for testing.
Differences from the React Native SDK
| Feature | React Native | Flutter |
|---|---|---|
| Login UI | Headless — build your own UI | Headless — build your own UI (optional pre-built widgets available) |
| State management | React hooks (useCrossmintAuth) | ChangeNotifier / ValueListenable |
| OAuth flow | System browser via expo-web-browser | System browser via url_launcher |
| OAuth callback | Linking.useURL() + createAuthSession() | CrossmintAuthCallbackRouter (automatic) |
| Token storage | expo-secure-store (encrypted) | flutter_secure_storage (encrypted) |
| Package | @crossmint/client-sdk-react-native-ui | crossmint_flutter |
| Deep link setup | scheme in app.json | AndroidManifest.xml + Info.plist |
| OTP prompts | Manual via useWalletOtpSigner hook | Automatic via CrossmintOtpSignerListener widget |
Moving to Production
When you are ready to go to production, Crossmint recommends:- Set up your own auth provider (Auth0, Firebase, Supabase, Stytch, etc.) and follow the Bring Your Own Auth guide to integrate it with Crossmint via JWT.
- Create a developer account on the production console.
- Create a production client API key on the API Keys page with the API scopes
users.create,users.read,wallets.read. - Configure JWT authentication for your auth provider in the Crossmint Console.
Next Steps
Bring Your Own Auth
Recommended for production — integrate your own auth provider via JWT
Webhooks
Get notified when a user signs up or updates their profile
Create Smart Wallets
Provision wallets automatically when users sign up

