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 the Swap Widget
Include theSwapWidget component where you want users to perform swaps:
