@spicenet-io/spiceflow-ui@5.0.3. See the
migration guide when upgrading an existing integration.
Installation
Install the stable version described by this reference:latest tag.
Stable UI
5.0.3 and core 0.10.3 include Elysium mainnet. See
Elysium mainnet for supported assets and RPC requirements.
Apps that pin the SDK must update their dependencies, rebuild, and deploy to adopt a new release.Peer Dependencies
The SDK requires the following peer dependencies. Install based on your wallet provider:Required Dependencies
These are always required:Keep the app on React 18 and resolve peers within the declared ranges. Do not bypass peer conflicts
as a default setup step. Reuse an existing compatible wallet/provider stack.
Wagmi and Viem compatibility
The examples pinwagmi@2.19.5 with viem@2.38.0, matching SDK 5.0.3’s
published development dependencies.
These are example pins, separate from the SDK’s minimum peer versions above.
Choose Wagmi and Viem versions as a pair. A new Wagmi release can use APIs missing from an older Viem
minor even when both satisfy broad peer ranges. The examples use Wagmi 2; an unversioned install
can select a different major. See Wagmi’s version migration guide
before changing majors.
Inspect the resolved tree when you see missing exports, incompatible client types, or peer errors:
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:
The example enables card and exchange deposits with
swapper={{ enabled: true }} on the
SpiceFlowProvider wrapping SpiceDeposit or SpiceAccount. The flag is required and these
options only appear on network="mainnet"; omitting it leaves them off.
See Card and Exchange Deposits for the full setup.PrivyProvider; add the chains you enable to its
supportedChains and your wagmi config.
2. Add Wallet Connection
Use theProviderLogin component to let users connect their wallet:
3. Add an Action and Account Menu
UseSpiceSupply 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:
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
Set your public Privy App ID in.env.local. For Next.js:
PrivyProvider. SpiceFlowProvider has a privyAppId prop, but it has no effect.
For Vite, use its public environment-variable prefix:
Local development and approved origins
- Use a development Privy app or app client.
An app client can have its own origin settings while sharing the app’s users. Pass its
clientIdtoPrivyProviderif you use one. - For app defaults, open Configuration > App settings > Domains > Allowed Origins in the
Privy dashboard. For an app client, open Configuration > App settings > Clients, select the
client, and edit its Allowed Origins. Add the exact local origin, for example
http://localhost:5173for Vite orhttp://localhost:3000for Next.js. Privy supports HTTP on localhost, with an explicit port. - Keep the dev server on that port. For Vite, set
server.port: 5173andserver.strictPort: truein your existing config so an occupied port fails instead of silently changing the origin. - For a preview, tunnel, phone, or custom hostname, use HTTPS and add that exact origin, without a path, to the same app or client’s allowlist. Check OAuth redirect settings separately when using an OAuth login method.
network="mainnet", including when the app runs locally.
Vite and optional Solana dependencies
Vite can resolve Privy’s optional Solana imports during a build even when your Spice Flow integration uses EVM chains. Errors such as a missinggetTransferSolInstruction export or
@solana/kit’s ./program-client-core specifier can indicate missing or mismatched optional peers.
@solana-program/system@0.10.0
requires Kit ^5.0, while 0.8.0
requires Kit ^3.0. Installing the newest program package alone can introduce a different Kit major.
Keep the compatible set pinned in your lockfile and rerun the production build.
Privy’s Vite troubleshooting guide
also provides a temporary shim for apps that do not use Solana wallets. Apps using Solana wallets
need the real compatible packages; the shim is not a replacement for their functionality.
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
