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 signer 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
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.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.
The recovery signer cannot be removed later
The recovery signer cannot be removed later
The signer chosen at creation time is the wallet’s root. Agents are added on top as scoped delegates and can be revoked, but the root recovery signer is permanent.
`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.
