Rising Tide Developers
UI PackagePrivy

Privy

How Privy fits into a Rising Tide app - which package supplies the provider, which pieces ship from @rising-tide/ui, and the provider order that has to hold.

Privy supplies embedded wallets so a user can sign in with a Google or X account and get a wallet without ever handling a key. Rising Tide wires it rather than wrapping it.

There is no @rising-tide/ui/privy entry point. The provider itself comes from Privy's own package, and the two Rising Tide pieces that sit beside it ship from @rising-tide/ui/auth:

PieceWhere it comes fromWhat it does
PrivyProvider@privy-io/react-authThe Privy context. Must be the outermost auth wrapper.
PrivyTokenProvider@rising-tide/ui/authReads the Privy access token and hands it to the protocol auth context.
PrivyStateSync@rising-tide/ui/authMirrors Privy login and logout state into the protocol user context, and provisions the Stacks wallet on first sign-in. Mounted by ProtocolUserProvider.
usePrivyToken@rising-tide/ui/authReads the current token from that context.

Do not assemble this by hand

RisingTideProviders from @rising-tide/ui/providers mounts all of it in the one order that works. Reach for the individual pieces only if you are assembling the stack yourself, and read the ordering rule below first.

import { RisingTideProviders } from '@rising-tide/ui/providers';

The ordering rule

PrivyProvider must be above the protocol auth providers. PrivyTokenProvider calls usePrivy(), which throws outside Privy's context - and the symptom is not a clear error at mount, it is a 401 on the first POST /api/users during signup.

// Correct
<PrivyProvider appId={...}>
  <ConditionalProviders>{children}</ConditionalProviders>
</PrivyProvider>

// Wrong - 401 on first signup
<ConditionalProviders>
  <PrivyProvider appId={...}>{children}</PrivyProvider>
</ConditionalProviders>

RisingTideProviders encodes exactly this, which is why it exists.

In this section

  • Setup - dashboard configuration, embedded wallets, cross-subdomain sessions, and how BYOW sits alongside