OnchainKit automatically sets up Wagmi and TanStack Query providers for you. However, you can provide your own custom Wagmi configuration for advanced use cases like custom connectors, chains, or storage options.Documentation Index
Fetch the complete documentation index at: https://base-a060aa97-pat-schemav2-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Default Setup
By default, OnchainKitProvider handles all the provider setup internally:- Wagmi configuration with Coinbase Wallet connector
- TanStack Query client for caching
- Optimized defaults for most applications
Custom Wagmi Configuration
For advanced control over wallet connectors, chains, or other Wagmi settings, wrap OnchainKitProvider with your own Wagmi providers:When to Use Custom Configuration
Consider custom Wagmi configuration when you need:- Multiple chains beyond the primary chain
- Advanced caching with custom QueryClient settings
- SSR support with cookie-based persistence
- Custom transports or RPC configurations
Common Patterns
Multi-chain Support
wagmi.ts
Custom Query Client
providers.tsx
Environment-specific Configuration
wagmi.ts
Important Notes
- Always place custom Wagmi and Query providers outside of OnchainKitProvider
- OnchainKit components will use your custom Wagmi configuration automatically
- The
chainprop on OnchainKitProvider should match your primary chain - Custom configurations require additional setup but provide maximum flexibility