- Configure the campaign to sign users in with their wallet.
- Load the widget in dApp mode.
- Answer the widget’s wallet requests with your app’s wallet.
- Keep the widget’s session in sync when the wallet disconnects or changes.
Prerequisites
- A React app that already connects wallets with wagmi and RainbowKit, and renders inside
WagmiProviderandRainbowKitProvider. - The Claimr widget set up with the shared loader, a provider, and a widget component, as described in Integrate Claimr into a React app. For Next.js or Vue, follow Next.js or Vue and Nuxt instead.
Configure the campaign
1
Open the sign-in options
In the Claimr admin panel, open your campaign, click Settings in the left-hand menu, then select Sign-in options.

2
Set the sign-in parameters
- Require login to start a task: users must sign in with their wallet before they can begin any task. Claimr needs this to link actions to a wallet address.
- Require token to start campaign (optional): users need a specific token to access the campaign.
- Wallet change is disabled (optional): prevents users from switching wallets mid-session.
- Disable users merge (optional): stops Claimr from merging user identities across sign-in methods.
3
Configure wallet sign-in
Select Wallet in the Select sign-in services field, select your blockchain in the Chains field, and enter a message in the Wallet message field. Users see this message when they sign, so describe why they are signing.
Load the widget in dApp mode
Addplatform: 'dapp' to the loader configuration in your Claimr provider. This tells the widget to send wallet operations to your app instead of looking for a wallet extension on its own.
data-platform="dapp" to it.
Answer wallet requests
The widget asks your app for wallet operations through one callback,on_wallet_request. It receives an object with an op field, and must return a result or throw an error:
Throwing tells the widget the operation failed, and the widget shows the error right away instead of waiting.
Create a component that assigns the handler with your wagmi hooks:
src/claimr/ClaimrWalletBridge.tsx
window.claimr exists when the handler is assigned:
send_transaction carries the transaction twice. request is the pre-encoded EIP-1193 call, and contract, method, args, and abi describe the same call at the ABI level. The example rebuilds the call with wagmi’s writeContractAsync. If your wallet library sends raw EIP-1193 requests, send request instead.
Sign the user in from your app (optional)
Withon_wallet_request in place, the widget asks for a signature when the user signs in inside the widget. If your app already runs its own sign-in step, you can sign the user in to Claimr at the same moment with connect_wallet:
connect_wallet is safe to call before the widget finishes loading: the loader keeps the wallet and passes it on when the campaign loads. The loader also remembers the wallet address across page loads.
How it works
When the user opens the app:- Your app loads, and the Claimr provider loads the widget script in dApp mode.
ClaimrWalletBridgeassignson_wallet_request.- The widget renders inside its container.
- The widget sends a
connectrequest. Your handler returns the connected address, or opens the RainbowKit modal if no wallet is connected. - The widget sends a
sign_messagerequest with its sign-in message. Your handler signs it with the user’s wallet. - Claimr verifies the signature and signs the user in.
- The widget sends a
send_transactionrequest. - Your handler switches the chain if needed, sends the transaction, and returns its hash.
- Claimr verifies the transaction.
logout(), so the widget does not keep a session for a wallet your app has let go of.
Summary
See the SDK guide for the full wallet callback reference.