Introduction
The user wallet is the root of every agent stablecoin flow. It is non-custodial and owned by the end user, with an email (or passkey) recovery method that stays in the user’s control. Your agent is later authorized to use the wallet as a signer with explicit spending limits, and that access can be revoked at any time. Subsequent logins from the same user return the same wallet — creation is idempotent.Prerequisites
- A staging Crossmint client API key from the Crossmint Console. In staging, all scopes are enabled by default.
- The user must be authenticated. If you have not set up authentication, see the Agents overview first.
Steps
1
Install the SDK
2
Wrap your app with the Crossmint providers
Set up
CrossmintProvider, CrossmintAuthProvider, and CrossmintWalletProvider at the root of your app. Pass createOnLogin to CrossmintWalletProvider so the SDK creates the user’s wallet automatically as soon as they sign in, with an email-recovery.3
Read the wallet from any component
Use When
useWallet() anywhere below the provider to access the wallet. The hook exposes a status field you can use to render a loading state during creation.status is loaded, wallet.address is the user’s wallet address and the wallet is ready for delegation.Manual Creation (Non-React or Server-Side)
If you are not using the React SDK — for example, creating the wallet server-side from a custom auth backend — use the wallets SDK directly:owner scopes the wallet to your authenticated user. Pass the same identifier on subsequent getWallet calls to resolve it.
Common Gotchas
Calling createOnLogin twice for the same user is safe
Calling createOnLogin twice for the same user is safe
Wallet creation is idempotent — repeated calls return the same wallet. You do not need to guard against double-creation in your UI.
Recovery is configured during wallet creation
Recovery is configured during wallet creation
The current API accepts one recovery method when the wallet is created. Add the agent as a scoped signer so you can revoke its access without changing the wallet address.
owner is required for server-side creation
owner is required for server-side creation
On the React SDK, the user is identified by the auth provider’s session. On the server, you must explicitly scope ownership with
owner: userId:<id> so the wallet resolves correctly on later getWallet calls.
