Client Wallets
Create user wallets from your frontend in under 5 minutes
Introduction
In this quickstart you will learn how to create and manage wallets directly in your frontend application using React. Here is a snippet of the demo that you can build in 5 minutes:
Demo of the Crossmint Wallets SDK
Mobile SDKs are available under private access. Contact us if you need access
This quickstart is written for EVM chains. Docs for Solana and other chains are coming soon. Contact us if you’d like to onboard today, while we get them ready.
From the Developer Console
Create a developer account
To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.
Then, navigate to project Settings > General, and set the wallet type to “Smart Wallets”.
Get an API Key
For client-side applications, you’ll need a public API key that’s safe to expose in your frontend code:
Navigate to the "Integrate" section on the left navigation bar, and ensure you're on the "API Keys" tab.
Within the Client-side keys section, click the "Create new key" button in the top right.
On the authorized origins section, enter http://localhost:3000
and click "Add origin".
Next, check the scopes labeled wallets.create
, wallets.read
, wallets:balance.read
, wallets:transactions.create
, wallets:transactions.read
, users.read
, users.create
.
Check the "JWT Auth" box.
Finally, create your key and save it for subsequent steps.
Integration Steps
This guide will start from scratch with an empty Next.js application using Shadcn UI for beautiful, accessible components. You'll install the required @crossmint/client-sdk-react-ui
dependency and add the wallet components. To get started:
For more detailed information about Shadcn UI installation with Next.js, you can refer to their official installation guide.
Set up the Project
Create a new Next.js application
When you see this message, select Next.js
and press Enter
to proceed.
Name your app `my-wallet-app` and press `Enter` to proceed
Change into the directory created in previous steps
Add needed components from Shadcn UI
Install @crossmint/client-sdk-react-ui
Open the project in your preferred code editor
React SDK Integration
Configure Environment
Create .env.local
in your project root:
Setup React Providers
Create a new file providers/Providers.tsx
with the following content:
Note: Change defaultChain
to the chain you’d like to start using your wallets on.
Then update your app/layout.tsx
to use these providers:
Add Authentication Component
Create a new file app/components/AuthButton.tsx
with the following content:
Add Wallet Component
Create a new file app/components/WalletComponent.tsx
with the following content:
Create Main Page
Create or update your app/page.tsx
with the following content:
Launch Development Server
- Start your development server:
- Visit http://localhost:3000 in your browser
- Click the “Login” button to start the authentication flow
- Follow the prompts to authenticate using Passkeys or email
- Once logged in, your wallet will be automatically created and displayed
If you’re using a port other than 3000, make sure to update your API key configuration in the Crossmint console to allow that port.
More info
Launching in Production
For production, the steps are almost identical, but some changes are required:
- Create a developer account on the production console
- Add credits to your account from Billing & Usage
- Create a production key on the API Keys page with the same API scopes
- Replace your test API key in
.env.local
with the production key
Learn More
Transfer Native Tokens
Send native tokens between wallets.
Transfer Tokens
Send ERC20 and other tokens.
Fetch Balance
Check wallet balances.
Fetch NFTs
Get NFTs owned by a wallet.
Dive into Advanced Topics
Other Links
Was this page helpful?