Skip to main content

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:

Provider-Specific Dependencies

Install depending on your chosen wallet provider:

Complete Installation

With Privy

With Dynamic


Basic Setup

1. Wrap Your App

Wrap your application with SpiceFlowProvider and configure your wallet provider:

2. Add Wallet Connection

Use the ProviderLogin component to let users connect their wallet:

3. Add a Deposit Flow

Add SpiceDeposit 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:
Or check for the window object:

Environment Variables

Store your provider credentials in environment variables:
Then use them in your code:

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