Skip to main content
This reference targets stable @spicenet-io/spiceflow-ui@4.10.0. See the migration guide when upgrading an existing integration.

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:
A peer-dependency conflict on a fresh install is expected (the SDK declares React 18 while some peers accept 18 or 19). Use --legacy-peer-deps and keep the app on React 18.

Wallet Provider

The SDK uses Privy for wallet connections:

Complete Installation


Basic Setup

1. Mount the Provider Stack

SpiceFlowProvider reads wallet state from Privy, wagmi, and react-query — it does not mount them. Your app provides all four, in this order. The SDK injects its stylesheet automatically in the browser; an existing explicit styles.css import remains supported:
See Quick Start Step 2 for the full wagmi and Privy configs. Already running Privy? Reuse your existing PrivyProvider — add the chains you enable to its supportedChains and your wagmi config.

2. Add Wallet Connection

Use the ProviderLogin component to let users connect their wallet:

3. Add an Action and Account Menu

Use SpiceSupply for protocol calls, or useSpiceSupply for your own UI. See the complete Quick Start example. For account funding and Spice-balance withdrawals, the combined component needs no modal wiring:
The SDK supplies default fee/funding batches, token metadata, venues and styles. Protocol addresses, ABIs, recipient policy and any required application updates remain yours to define.

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:
The app ID belongs on your own PrivyProvider. SpiceFlowProvider has a privyAppId prop, but it has no effect.

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