Skip to main content
Crossmint provides turn-key connectors for the most popular auth providers, including Auth0, Firebase, Supabase, Stytch, Cognito, and Kinde. When you bring your own auth, Crossmint automatically extracts the user ID from your provider’s JWT and assigns it to the wallet’s owner property. Wallet creation, transaction signing, and balance reads all work the same way regardless of which auth provider you use. If you’re just getting started or prototyping, Crossmint Auth is a great way to move fast in staging before connecting your own provider.

Prerequisites

  • API Key: Ensure you have an API key with the scopes: wallets.create.

Using your own auth provider

1

Configure JWT Authentication in the Crossmint Console

  1. Navigate to your project in the Crossmint Console.
  2. Go to the API Keys section from the sidebar.
  3. Scroll down to the JWT authentication section.
  4. Choose your preferred authentication method:
  • 3P Auth providers: Select from supported providers such as Auth0, Stytch, Cognito, Firebase, Kinde, or Supabase. Enter any required environment IDs or configuration details.
  • Custom tokens: Opt to issue and manage your own JWTs.
  1. After making your selection and providing any necessary details, click Save JWT auth settings to apply your configuration.
JWT Authentication Settings
2

Add the Crossmint providers to your app

Add the necessary Crossmint providers to your app together with your own auth provider. With the current setup, a wallet will be created automatically on login.
"use client";

import {
    CrossmintProvider,
    CrossmintWalletProvider,
    useCrossmint,
} from "@crossmint/client-sdk-react-ui";

import { YourAuthProvider } from "@your-auth-provider";

// Get the JWT from your auth provider and pass it to the Crossmint provider
const { jwt } = useYourAuthProviderHook();
const { setJwt } = useCrossmint();

useEffect(() => {
    setJwt(jwt);
}, [jwt]);

export function Providers({ children }: { children: React.ReactNode }) {
    return (
        <YourAuthProvider>
            <CrossmintProvider apiKey="<crossmint-client-api-key>">
                <CrossmintWalletProvider>
                    {children}
                </CrossmintWalletProvider>
            </CrossmintProvider>
        </YourAuthProvider>
    );
}
3

Passthrough the jwt information to the Crossmint provider

Create the wallet on login once the jwt and the email are available.
"use client";

import { useYourAuthProviderHook } from "@your-auth-provider";
import { useEffect } from "react";
import { useCrossmint, useWallet } from "@crossmint/client-sdk-react-ui";

export function YourComponent() {
    const { email } = useYourAuthProviderHook();
    const { jwt } = useCrossmint();
    const { getOrCreateWallet } = useWallet();

    useEffect(() => {
        if (email != null && jwt != null) {
            getOrCreateWallet({ signer: { type: "email", email: email } });
        }
    }, [email, jwt]);

    // your component logic here
    return (
        <div>
            <h1>Your Component</h1>
        </div>
    );
}
4
See the React SDK reference for more details on providers and hooks.