Skip to Content
React APIRabitProvider

<RabitProvider>

Wraps your app and makes every Rabit hook and component available below it. Configure it once with a single config object.

import { RabitProvider, PRESET_EVM_CHAINS, ETHEREUM_SEPOLIA, PRESET_SOLANA_CHAINS } from 'rabitwallet' <RabitProvider config={{ projectId: 'your_project_id', apiKey: 'pk_live_…', apiBaseUrl: 'https://your-api.example.com', app: { name: 'My dApp' }, evmChains: PRESET_EVM_CHAINS, defaultEvmChainId: ETHEREUM_SEPOLIA.id, solanaChains: PRESET_SOLANA_CHAINS, defaultSolanaCluster: 'devnet', authMethods: ['email', 'google'], }} > <App /> </RabitProvider>

Config

PropTypeDefaultDescription
projectId*stringYour project id.
apiKey*stringPublishable key (pk_test_… / pk_live_…). Safe to expose on the client.
apiBaseUrlstring'http://localhost:3001'URL of your deployed Rabit API.
app*{ name: string }App metadata shown in the auth modal.
evmChainsEvmChain[]EVM chains to enable. Use PRESET_EVM_CHAINS or build your own with defineEvmChain().
defaultEvmChainIdnumberChain the wallet starts on.
solanaChainsSolanaChain[]Solana clusters to enable (PRESET_SOLANA_CHAINS).
defaultSolanaCluster'mainnet' | 'devnet' | 'testnet''devnet'Solana cluster to start on.
authMethods('email' | 'google')[]['email']Sign-in methods to offer.
themeThemeConfigColors, radius, fonts. See Theming.
smartAccountType'kernel' | 'safe' | 'light'Enable ERC-4337 smart accounts. See Smart accounts.
bundlerUrlstringERC-4337 bundler RPC (for smart accounts).
paymasterUrlstringPaymaster RPC for sponsored gas (optional).

Use the publishable key

Ship the publishable key (pk_live_… / pk_test_…) on the client. Your API’s server secrets (JWT, database, Resend) never belong in the frontend.