Privy Skill Reference
Product summary
Privy is a programmable wallet infrastructure platform for building financial applications. It provides embedded wallets, authentication, transaction execution, and policy controls across 50+ blockchains including Ethereum, Solana, Bitcoin, and Tempo. Agents use Privy to authenticate users, create and manage wallets, execute transactions, enforce spending policies, and build complete financial products without building wallet infrastructure from scratch.
Key files and commands:
- Dashboard: https://dashboard.privy.io (configure apps, login methods, policies)
- App ID and App Secret: Found in Dashboard > App Settings > Basics
- Client ID: Required for mobile/non-web platforms (Dashboard > App Settings > Clients)
- REST API:
https://api.privy.io/v1/ (requires Basic Auth with app ID:secret)
- SDKs: React (
@privy-io/react-auth), Node.js (@privy-io/node), Swift, Android, Flutter, Java, Go, Rust, Ruby
- Primary docs: https://docs.privy.io
When to use
Reach for Privy when:
- Building consumer apps that need user authentication + embedded wallets
- Creating organization or treasury wallets with multi-sig controls
- Building AI agents that need to hold assets and transact autonomously
- Implementing spending policies, transaction limits, or approval workflows
- Executing transactions across multiple blockchains from a single interface
- Migrating users from another wallet provider
- Setting up funding flows (fiat onramps, crypto deposits, card spend)
- Implementing yield integrations or token swaps
- Requiring role-based access control or delegation patterns
Do not use Privy for: pure authentication without wallets (use Auth0, Firebase instead), or if you need complete control over key management without any abstraction.
Quick reference
SDK Installation
| Platform |
Package |
Command |
| React |
@privy-io/react-auth |
npm install @privy-io/react-auth |
| Node.js |
@privy-io/node |
npm install @privy-io/node |
| React Native |
@privy-io/react-native-auth |
npm install @privy-io/react-native-auth |
| Swift |
Privy Swift SDK |
Via Swift Package Manager |
| Android |
Privy Android SDK |
Via Gradle |
Core Concepts
| Concept |
Definition |
Use case |
| User |
Individual authenticated in your app |
Consumer wallets, personal accounts |
| Wallet |
Blockchain account (embedded or external) |
Holding assets, signing transactions |
| Owner |
Entity with full control (user, auth key, or quorum) |
Determines who can modify wallet |
| Signer |
Additional party with scoped permissions |
Server automation, delegated access |
| Policy |
Rules constraining wallet actions |
Spending limits, recipient whitelists |
| Authorization Key |
P256 cryptographic key for server control |
Backend wallet management |
| Key Quorum |
M-of-K multi-sig approval |
Shared control, treasury operations |
Authentication Methods
Configure in Dashboard > Configuration > Authentication:
- Email / SMS / WhatsApp
- Social (Google, Discord, Twitter, Farcaster, etc.)
- Passkeys (WebAuthn)
- External wallets (MetaMask, Phantom)
- Custom JWT (bring your own auth provider)
- Guest accounts (instant sign-in)
Wallet Control Models
| Model |
Owner |
Signers |
Use case |
| User-owned |
User |
None |
Self-custodial consumer wallets |
| User + server |
User |
Server (scoped) |
Automated trading, limit orders |
| App-owned |
Auth key |
None |
Treasury, bots, agents |
| Custodial |
Licensed custodian |
None |
Institutional FBO accounts |
REST API Headers (Required)
Authorization: Basic <base64(app_id:app_secret)>
privy-app-id: <app_id>
Content-Type: application/json
Common Wallet Actions
| Action |
Endpoint |
Purpose |
| Create wallet |
POST /v1/wallets |
Provision new wallet |
| Get wallet |
GET /v1/wallets/{id} |
Fetch wallet details |
| Send transaction |
POST /v1/wallets/{id}/rpc |
Execute blockchain action |
| Get balance |
GET /v1/wallets/{id}/balance |
Check asset holdings |
| Create policy |
POST /v1/policies |
Define spending rules |
| Create user |
POST /v1/users |
Onboard new user |
Decision guidance
When to use embedded vs external wallets
| Scenario |
Embedded |
External |
| New users, no existing wallet |
✓ |
✗ |
| Users have MetaMask/Phantom |
✗ |
✓ |
| Need full control over UX |
✓ |
✗ |
| Users want to bring existing assets |
✗ |
✓ |
| Mobile app |
✓ |
Limited |
| Require key export |
✓ |
✗ |
When to use client-side vs server-side SDKs
| Scenario |
Client SDK |
Server SDK |
| User authentication |
✓ |
✗ |
| Wallet creation for users |
✓ |
✓ |
| Server-controlled wallets |
✗ |
✓ |
| Transaction signing |
✓ |
✓ |
| Policy management |
✗ |
✓ |
| User management |
✗ |
✓ |
When to use policies vs key quorums
| Need |
Policies |
Key Quorums |
| Spending limits |
✓ |
✗ |
| Recipient whitelists |
✓ |
✗ |
| Multi-sig approval |
✗ |
✓ |
| Time-based rules |
✓ |
✗ |
| Contract interaction control |
✓ |
✗ |
| Shared ownership |
✗ |
✓ |
Workflow
1. Set up your Privy app
- Go to https://dashboard.privy.io and create an app
- Copy your App ID and App Secret from App Settings > Basics
- For mobile/non-web: Create an app client in App Settings > Clients
- Configure login methods in Configuration > Authentication
- (Optional) Configure appearance in Configuration > Appearance
2. Integrate authentication (client-side)
- Install the appropriate SDK (
@privy-io/react-auth for React, etc.)
- Wrap your app with
PrivyProvider, passing appId and clientId
- Use
usePrivy() hook to access login(), logout(), and user state
- Wait for
ready === true before consuming Privy state
- Call
login() to trigger authentication modal
3. Create or connect wallets
- For automatic wallet creation: Set
embeddedWallets.ethereum.createOnLogin in PrivyProvider config
- For manual creation: Use
useCreateWallet() hook (client) or wallets().create() (server)
- Specify wallet owner: user ID (user-owned) or authorization key (app-owned)
- Optionally attach policies or signers at creation time
- Retrieve wallet address from response
4. Execute transactions
- Get wallet reference from
useWallets() hook or API
- Prepare transaction parameters (to, value, data, etc.)
- Call appropriate signing method:
eth_sendTransaction, signTransaction, etc.
- For server-side: Use
intents() API to propose and authorize transactions
- Handle response: check status, monitor for confirmation via webhooks
5. Enforce policies
- Create policy via Dashboard or
POST /v1/policies API
- Define rules with conditions (amount limits, recipient addresses, etc.)
- Attach policy to wallet at creation or via
PATCH /v1/wallets/{id}
- Policy engine evaluates every request; DENY takes precedence
- If no rule matches, request is denied by default
6. Monitor with webhooks
- Configure webhook endpoint in Dashboard > Configuration > Webhooks
- Subscribe to relevant events (user.created, wallet.funds_deposited, transaction.confirmed, etc.)
- Verify webhook signature using your app secret
- Implement retry logic with exponential backoff
- Return 200 status to acknowledge receipt
Common gotchas
- HTTPS required: Embedded wallets only work in secure contexts (https://). Localhost is treated as secure by browsers.
- Ready state: Always check
ready === true before using Privy hooks; state may be stale during initialization.
- Policy defaults to DENY: If a wallet has a policy but no rule matches the request, the request is denied. Include an "allow all" rule if needed.
- Rate limits: REST API has rate limits; implement exponential backoff for retries (HTTP 429 responses).
- Idempotency keys: Use idempotency keys for wallet creation and transaction requests to prevent duplicates.
- Authorization headers: REST API requires both Basic Auth and
privy-app-id header; requests missing either are rejected.
- Chain-specific policies: Policies are chain-specific; create separate policies for Ethereum vs Solana wallets.
- Key export security: Users can export private keys; warn them about custody implications.
- Webhook verification: Always verify webhook signatures; don't trust webhook data without verification.
- Multiple wallets: Users can have multiple wallets per chain (HD wallets); use
createAdditional: true to enable.
- External wallet linking: External wallets are read-only for signing; use embedded wallets for full control.
- MFA not automatic: Multi-factor authentication must be explicitly configured; email/SMS alone are not phishing-resistant.
Verification checklist
Before submitting work with Privy:
Resources
Comprehensive navigation: https://docs.privy.io/llms.txt
Critical documentation pages:
- Key Concepts — Understand authentication, wallets, and controls
- React Setup & Quickstart — Get started with client-side integration
- REST API Introduction — Server-side wallet and user management
- Policies Overview — Define spending rules and constraints
- Wallet Creation — Provision wallets across SDKs
- Webhooks — Monitor wallet and transaction events
For additional documentation and navigation, see: https://docs.privy.io/llms.txt
1---2name: privy3description: Use when building wallet infrastructure, authentication systems, or financial applications. Reach for Privy when you need to create embedded wallets, manage user authentication, control wallet permissions with policies, execute transactions across blockchains, or build treasury/agent wallets with programmable controls.4---5
6# Privy Skill Reference
7
8## Product summary
9
10Privy is a programmable wallet infrastructure platform for building financial applications. It provides embedded wallets, authentication, transaction execution, and policy controls across 50+ blockchains including Ethereum, Solana, Bitcoin, and Tempo. Agents use Privy to authenticate users, create and manage wallets, execute transactions, enforce spending policies, and build complete financial products without building wallet infrastructure from scratch.
11
12**Key files and commands:**
13- Dashboard: https://dashboard.privy.io (configure apps, login methods, policies)
14- App ID and App Secret: Found in Dashboard > App Settings > Basics
15- Client ID: Required for mobile/non-web platforms (Dashboard > App Settings > Clients)
16- REST API: `https://api.privy.io/v1/` (requires Basic Auth with app ID:secret)
17- SDKs: React (`@privy-io/react-auth`), Node.js (`@privy-io/node`), Swift, Android, Flutter, Java, Go, Rust, Ruby
18- Primary docs: https://docs.privy.io
19
20## When to use
21
22Reach for Privy when:
23- Building consumer apps that need user authentication + embedded wallets
24- Creating organization or treasury wallets with multi-sig controls
25- Building AI agents that need to hold assets and transact autonomously
26- Implementing spending policies, transaction limits, or approval workflows
27- Executing transactions across multiple blockchains from a single interface
28- Migrating users from another wallet provider
29- Setting up funding flows (fiat onramps, crypto deposits, card spend)
30- Implementing yield integrations or token swaps
31- Requiring role-based access control or delegation patterns
32
33Do not use Privy for: pure authentication without wallets (use Auth0, Firebase instead), or if you need complete control over key management without any abstraction.
34
35## Quick reference
36
37### SDK Installation
38
39| Platform | Package | Command |
40|----------|---------|---------|
41| React | `@privy-io/react-auth` | `npm install @privy-io/react-auth` |
42| Node.js | `@privy-io/node` | `npm install @privy-io/node` |
43| React Native | `@privy-io/react-native-auth` | `npm install @privy-io/react-native-auth` |
44| Swift | Privy Swift SDK | Via Swift Package Manager |
45| Android | Privy Android SDK | Via Gradle |
46
47### Core Concepts
48
49| Concept | Definition | Use case |
50|---------|-----------|----------|
51| **User** | Individual authenticated in your app | Consumer wallets, personal accounts |
52| **Wallet** | Blockchain account (embedded or external) | Holding assets, signing transactions |
53| **Owner** | Entity with full control (user, auth key, or quorum) | Determines who can modify wallet |
54| **Signer** | Additional party with scoped permissions | Server automation, delegated access |
55| **Policy** | Rules constraining wallet actions | Spending limits, recipient whitelists |
56| **Authorization Key** | P256 cryptographic key for server control | Backend wallet management |
57| **Key Quorum** | M-of-K multi-sig approval | Shared control, treasury operations |
58
59### Authentication Methods
60
61Configure in Dashboard > Configuration > Authentication:
62- Email / SMS / WhatsApp
63- Social (Google, Discord, Twitter, Farcaster, etc.)
64- Passkeys (WebAuthn)
65- External wallets (MetaMask, Phantom)
66- Custom JWT (bring your own auth provider)
67- Guest accounts (instant sign-in)
68
69### Wallet Control Models
70
71| Model | Owner | Signers | Use case |
72|-------|-------|---------|----------|
73| User-owned | User | None | Self-custodial consumer wallets |
74| User + server | User | Server (scoped) | Automated trading, limit orders |
75| App-owned | Auth key | None | Treasury, bots, agents |
76| Custodial | Licensed custodian | None | Institutional FBO accounts |
77
78### REST API Headers (Required)
79
80```
81Authorization: Basic <base64(app_id:app_secret)>
82privy-app-id: <app_id>
83Content-Type: application/json
84```
85
86### Common Wallet Actions
87
88| Action | Endpoint | Purpose |
89|--------|----------|---------|
90| Create wallet | `POST /v1/wallets` | Provision new wallet |
91| Get wallet | `GET /v1/wallets/{id}` | Fetch wallet details |
92| Send transaction | `POST /v1/wallets/{id}/rpc` | Execute blockchain action |
93| Get balance | `GET /v1/wallets/{id}/balance` | Check asset holdings |
94| Create policy | `POST /v1/policies` | Define spending rules |
95| Create user | `POST /v1/users` | Onboard new user |
96
97## Decision guidance
98
99### When to use embedded vs external wallets
100
101| Scenario | Embedded | External |
102|----------|----------|----------|
103| New users, no existing wallet | ✓ | ✗ |
104| Users have MetaMask/Phantom | ✗ | ✓ |
105| Need full control over UX | ✓ | ✗ |
106| Users want to bring existing assets | ✗ | ✓ |
107| Mobile app | ✓ | Limited |
108| Require key export | ✓ | ✗ |
109
110### When to use client-side vs server-side SDKs
111
112| Scenario | Client SDK | Server SDK |
113|----------|-----------|-----------|
114| User authentication | ✓ | ✗ |
115| Wallet creation for users | ✓ | ✓ |
116| Server-controlled wallets | ✗ | ✓ |
117| Transaction signing | ✓ | ✓ |
118| Policy management | ✗ | ✓ |
119| User management | ✗ | ✓ |
120
121### When to use policies vs key quorums
122
123| Need | Policies | Key Quorums |
124|------|----------|-------------|
125| Spending limits | ✓ | ✗ |
126| Recipient whitelists | ✓ | ✗ |
127| Multi-sig approval | ✗ | ✓ |
128| Time-based rules | ✓ | ✗ |
129| Contract interaction control | ✓ | ✗ |
130| Shared ownership | ✗ | ✓ |
131
132## Workflow
133
134### 1. Set up your Privy app
135
1361. Go to https://dashboard.privy.io and create an app
1372. Copy your App ID and App Secret from App Settings > Basics
1383. For mobile/non-web: Create an app client in App Settings > Clients
1394. Configure login methods in Configuration > Authentication
1405. (Optional) Configure appearance in Configuration > Appearance
141
142### 2. Integrate authentication (client-side)
143
1441. Install the appropriate SDK (`@privy-io/react-auth` for React, etc.)
1452. Wrap your app with `PrivyProvider`, passing `appId` and `clientId`
1463. Use `usePrivy()` hook to access `login()`, `logout()`, and `user` state
1474. Wait for `ready === true` before consuming Privy state
1485. Call `login()` to trigger authentication modal
149
150### 3. Create or connect wallets
151
1521. For automatic wallet creation: Set `embeddedWallets.ethereum.createOnLogin` in PrivyProvider config
1532. For manual creation: Use `useCreateWallet()` hook (client) or `wallets().create()` (server)
1543. Specify wallet owner: user ID (user-owned) or authorization key (app-owned)
1554. Optionally attach policies or signers at creation time
1565. Retrieve wallet address from response
157
158### 4. Execute transactions
159
1601. Get wallet reference from `useWallets()` hook or API
1612. Prepare transaction parameters (to, value, data, etc.)
1623. Call appropriate signing method: `eth_sendTransaction`, `signTransaction`, etc.
1634. For server-side: Use `intents()` API to propose and authorize transactions
1645. Handle response: check status, monitor for confirmation via webhooks
165
166### 5. Enforce policies
167
1681. Create policy via Dashboard or `POST /v1/policies` API
1692. Define rules with conditions (amount limits, recipient addresses, etc.)
1703. Attach policy to wallet at creation or via `PATCH /v1/wallets/{id}`
1714. Policy engine evaluates every request; DENY takes precedence
1725. If no rule matches, request is denied by default
173
174### 6. Monitor with webhooks
175
1761. Configure webhook endpoint in Dashboard > Configuration > Webhooks
1772. Subscribe to relevant events (user.created, wallet.funds_deposited, transaction.confirmed, etc.)
1783. Verify webhook signature using your app secret
1794. Implement retry logic with exponential backoff
1805. Return 200 status to acknowledge receipt
181
182## Common gotchas
183
184- **HTTPS required**: Embedded wallets only work in secure contexts (https://). Localhost is treated as secure by browsers.
185- **Ready state**: Always check `ready === true` before using Privy hooks; state may be stale during initialization.
186- **Policy defaults to DENY**: If a wallet has a policy but no rule matches the request, the request is denied. Include an "allow all" rule if needed.
187- **Rate limits**: REST API has rate limits; implement exponential backoff for retries (HTTP 429 responses).
188- **Idempotency keys**: Use idempotency keys for wallet creation and transaction requests to prevent duplicates.
189- **Authorization headers**: REST API requires both Basic Auth and `privy-app-id` header; requests missing either are rejected.
190- **Chain-specific policies**: Policies are chain-specific; create separate policies for Ethereum vs Solana wallets.
191- **Key export security**: Users can export private keys; warn them about custody implications.
192- **Webhook verification**: Always verify webhook signatures; don't trust webhook data without verification.
193- **Multiple wallets**: Users can have multiple wallets per chain (HD wallets); use `createAdditional: true` to enable.
194- **External wallet linking**: External wallets are read-only for signing; use embedded wallets for full control.
195- **MFA not automatic**: Multi-factor authentication must be explicitly configured; email/SMS alone are not phishing-resistant.
196
197## Verification checklist
198
199Before submitting work with Privy:
200
201- [ ] App ID and App Secret are stored securely (environment variables, not hardcoded)
202- [ ] PrivyProvider wraps the entire app and `ready` state is checked before consuming Privy
203- [ ] Authentication flow is tested (login, logout, session persistence)
204- [ ] Wallet creation is tested (automatic or manual, correct owner specified)
205- [ ] Transactions are tested on testnet before production
206- [ ] Policies are attached to wallets and tested with boundary conditions
207- [ ] Webhook endpoint is configured and signature verification is implemented
208- [ ] Error handling covers NotFoundError, rate limits, and network failures
209- [ ] HTTPS is enforced for production (embedded wallets require secure context)
210- [ ] Idempotency keys are used for wallet creation and transaction requests
211- [ ] Rate limit retry logic uses exponential backoff
212- [ ] User data is not logged or exposed in error messages
213- [ ] External wallets are tested if supported (MetaMask, Phantom, etc.)
214
215## Resources
216
217**Comprehensive navigation:** https://docs.privy.io/llms.txt
218
219**Critical documentation pages:**
2201. [Key Concepts](https://docs.privy.io/basics/key-concepts) — Understand authentication, wallets, and controls
2212. [React Setup & Quickstart](https://docs.privy.io/basics/react/setup) — Get started with client-side integration
2223. [REST API Introduction](https://docs.privy.io/api-reference/introduction) — Server-side wallet and user management
2234. [Policies Overview](https://docs.privy.io/controls/policies/overview) — Define spending rules and constraints
2245. [Wallet Creation](https://docs.privy.io/wallets/wallets/create/create-a-wallet) — Provision wallets across SDKs
2256. [Webhooks](https://docs.privy.io/api-reference/webhooks/overview) — Monitor wallet and transaction events
226
227---
228
229> For additional documentation and navigation, see: https://docs.privy.io/llms.txt