<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
| Prop | Type | Default | Description |
|---|---|---|---|
projectId* | string | — | Your project id. |
apiKey* | string | — | Publishable key (pk_test_… / pk_live_…). Safe to expose on the client. |
apiBaseUrl | string | 'http://localhost:3001' | URL of your deployed Rabit API. |
app* | { name: string } | — | App metadata shown in the auth modal. |
evmChains | EvmChain[] | — | EVM chains to enable. Use PRESET_EVM_CHAINS or build your own with defineEvmChain(). |
defaultEvmChainId | number | — | Chain the wallet starts on. |
solanaChains | SolanaChain[] | — | 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. |
theme | ThemeConfig | — | Colors, radius, fonts. See Theming. |
smartAccountType | 'kernel' | 'safe' | 'light' | — | Enable ERC-4337 smart accounts. See Smart accounts. |
bundlerUrl | string | — | ERC-4337 bundler RPC (for smart accounts). |
paymasterUrl | string | — | Paymaster 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.