Installation
Install the Spice Flow SDK using npm, yarn, or pnpm:Peer Dependencies
The SDK requires the following peer dependencies. Install based on your wallet provider:Required Dependencies
These are always required:| Package | Version | Description |
|---|---|---|
react | ^18.0.0 | React library |
react-dom | ^18.0.0 | React DOM |
viem | >=2.21.0 | Ethereum interface library |
wagmi | >=2.12.0 | React hooks for Ethereum |
@tanstack/react-query | >=5.0.0 | Data fetching library |
axios | >=1.0.0 | HTTP client |
Provider-Specific Dependencies
Install depending on your chosen wallet provider:| Package | Version | Provider |
|---|---|---|
@privy-io/react-auth | >=2.24.0 <4.0.0 | Privy |
@dynamic-labs/sdk-react-core | >=3.9.13 <5.0.0 | Dynamic |
@dynamic-labs/ethereum | >=3.9.13 <5.0.0 | Dynamic |
@dynamic-labs/wallet-connector-core | >=3.9.13 <5.0.0 | Dynamic |
Complete Installation
With Privy
With Dynamic
Basic Setup
1. Wrap Your App
Wrap your application withSpiceFlowProvider and configure your wallet provider:
2. Add Wallet Connection
Use theProviderLogin component to let users connect their wallet:
3. Add a Deposit Flow
AddSpiceDeposit to let users deposit from any chain:
Complete Example
Here’s a complete Next.js example with deposit and withdraw:Next.js Considerations
If you’re using Next.js with Server-Side Rendering (SSR), wrap components that use Spice Flow in a client component:Environment Variables
Store your provider credentials in environment variables:Next Steps
Components
Learn about all available components and their props
Hooks
Use React hooks to build custom UIs
Configuration
Configure wallet providers, chains, and more
Quick Start Guide
Build your first Spice Flow app step-by-step
