Xpersona
P

privy-integration

CLAWHUB · Unverified

Integrates Privy authentication, embedded wallets, and agent payment protocols into web and agentic apps. Covers React SDK (PrivyProvider, hooks, wagmi), Node.js SDK, smart wallets (ERC-4337), x402 and MPP machine payments, Tempo chain, and agentic wallets with policies. Use when setting up Privy auth, creating embedded or agentic wallets, adding x402 or MPP payments, integrating with Tempo, configuring wallet policies, or connecting Privy to MCP/Agent Auth flows.

62
Rank
84
Safety
1.7k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bp3v1hm1dnkzey0c9tfh02183j0y5:privy-integration
  1. Install using `clawhub skill install s17bp3v1hm1dnkzey0c9tfh02183j0y5:privy-integration` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/tenequm/privy-integration before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-privy-integration/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

144,985 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: privy-integration
description: Integrates Privy authentication, embedded wallets, and agent payment protocols into web and agentic apps. Covers React SDK (PrivyProvider, hooks, wagmi), Node.js SDK, smart wallets (ERC-4337), x402 and MPP machine payments, Tempo chain, and agentic wallets with policies. Use when setting up Privy auth, creating embedded or agentic wallets, adding x402 or MPP payments, integrating with Tempo, configuring wallet policies, or connecting Privy to MCP/Agent Auth flows.
metadata:
  version: "0.4.4"
  categories: "development, security, finance"
  topics: "privy, embedded-wallets, authentication, x402, smart-wallets"
  upstream: "@privy-io/react-auth@3.29.1, @privy-io/node@0.20.0, @privy-io/wagmi@4.0.11, mppx@0.6.30, @x402/fetch@2.14.0"
  openclaw:
    homepage: https://github.com/tenequm/skills/tree/main/skills/privy-integration
    emoji: "🔐"
    primaryEnv: PRIVY_APP_SECRET
    envVars:
      - name: PRIVY_APP_ID
        required: false
        description: Privy App ID (server-side).
      - name: PRIVY_APP_SECRET
        required: false
        description: Privy App Secret for server SDK auth.
      - name: PRIVY_WEBHOOK_SIGNING_SECRET
        required: false
        description: Secret for verifying inbound Privy webhooks.
      - name: MPP_RECIPIENT
        required: false
        description: MPP payment recipient address (Tempo).
      - name: NEXT_PUBLIC_PRIVY_APP_ID
        required: false
        description: Public Privy App ID for client SDK.
---

# Privy Integration

Privy provides authentication and wallet infrastructure for apps built on crypto rails. Embed self-custodial wallets, authenticate users via email/SMS/socials/passkeys/wallets, and transact on EVM and Solana chains. Also supports agent payment protocols (x402, MPP) and autonomous agentic wallets.

Key packages:
- `@privy-io/react-auth` - React SDK (auth + wallets + x402)
- `@privy-io/react-auth/solana` - Solana wallet hooks
- `@privy-io/react-auth/smart-wallets` - Smart wallets (ERC-4337)
- `@privy-io/wagmi` - wagmi v2 connector
- `@privy-io/node` - Server-side SDK (replaces deprecated `@privy-io/server-auth`)
- `mppx` - MPP client/server SDK (settles on Tempo)

Docs: Privy ships an official agent skill - `npx skills add https://docs.privy.io` (or fetch `https://docs.privy.io/skill.md`). The machine-readable doc index is `https://docs.privy.io/llms-full.txt` (plus `sitemap.xml`); `llms.txt` now only points to the skill installer. Privy restructures docs often - do not guess URLs, they 404.

## Workflow Decision Tree

**Setting up Privy auth in a React app?** -> Quick Start below, then [references/react-sdk.md](references/react-sdk.md)
**Adding wagmi/viem to a Privy app?** -> Wagmi Integration below, then [references/react-sdk.md](references/react-sdk.md)
**Working server-side (Node.js)?** -> Server-Side section below, then [references/server-sdk.md](references/server-sdk.md)
**Adding x402 or MPP payments?** -> x402/MPP sections below

_meta.json

{
  "ownerId": "kn76gpsgjw5chv0xvzbzcb8cxn81x46r",
  "slug": "privy-integration",
  "version": "0.4.4",
  "publishedAt": 1787314305156
}

references/agent-auth.md

# Agent Auth & Agentic Wallets Reference

Privy's agentic wallet infrastructure, the Agent Auth Protocol for per-agent identity, MCP authorization patterns, and Better Auth integration bridges.

## Table of Contents

- [Agentic Wallets](#agentic-wallets)
- [Agent Auth Protocol](#agent-auth-protocol)
- [MCP Authorization](#mcp-authorization)
- [Better Auth Integration](#better-auth-integration)

## Agentic Wallets

Privy server wallets can be configured as autonomous agent wallets with policy-based controls. Two control models cover different trust levels.

Docs: https://docs.privy.io/recipes/agent-integrations/agentic-wallets

### Model 1: Agent-Controlled, Developer-Owned

The application backend controls the wallet via authorization keys. Fully autonomous agents execute transactions within policy constraints without user approval.

- Use when: agents need full autonomy (trading bots, automated payments, infrastructure provisioning)
- Risk: developer bears full responsibility for agent behavior

### Model 2: User-Owned with Agent Signers

Users maintain wallet ownership and grant limited permissions to agents. The agent operates as an additional signer with scoped policies. Users retain ultimate control and can revoke agent access.

- Use when: users delegate specific tasks (portfolio rebalancing, scheduled payments)
- Risk: lower - user retains revocation authority

### Setup Steps

1. **Create authorization keys** in Privy Dashboard (optionally in a key quorum for multi-party approval)
2. **Define agent policies** (spending limits, chain restrictions, contract allowlists)
3. **Create agent wallet** with `owner_id` set to authorization key ID and `policy_ids` array
4. **Execute transactions** via Privy's API (validated against attached policies)
5. **Monitor** via webhooks (transaction events, balance changes)

### Policy Examples

**Spending limit** (max value per transaction):
```json
{
  "name": "Max 0.1 ETH per tx",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "value",
      "operator": "lte",
      "value": "100000000000000000"
    }
  ],
  "action": "ALLOW"
}
```

**Chain restriction**:
```json
{
  "name": "Base mainnet only",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "chain_id",
      "operator": "eq",
      "value": "8453"
    }
  ],
  "action": "ALLOW"
}
```

**Contract allowlist**:
```json
{
  "name": "Only Uniswap Router",
  "method": "eth_sendTransaction",
  "conditions": [
    {
      "field_source": "ethereum_transaction",
      "field": "to",
      "operator": "in",
      "value": ["0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD"]
    }
  ],
  "action": "ALLOW"
}
```

### Policy Condition Operators

| Operator | Description |
|----------|-------------|
| `eq` | Equals |
| `neq` | Not equals |
| `gt` | Greater than |
| `gte` | Greater than or equal |
| `lt` | Less than |
| `lte` | Les

references/agent-payments.md

# Agent Payments Reference

Privy integration with machine-to-machine payment protocols: x402, MPP (Machine Payments Protocol), and the Tempo blockchain.

## Table of Contents

- [x402 Protocol](#x402-protocol)
- [MPP (Machine Payments Protocol)](#mpp-machine-payments-protocol)
- [Tempo Chain](#tempo-chain)
- [x402 vs MPP Comparison](#x402-vs-mpp-comparison)

## x402 Protocol

x402 is an open payment protocol for instant, automatic payments over HTTP. When a resource requires payment, the server responds with `402 Payment Required`. The client constructs an `X-PAYMENT` header with a signed payment authorization and retries. A facilitator handles on-chain settlement so users only need USDC (not ETH/SOL for gas).

Protocol site: https://x402.org

### React Integration (useX402Fetch)

Built into `@privy-io/react-auth` since v3.7.0. No extra packages needed.

```tsx
import {useX402Fetch, useWallets} from '@privy-io/react-auth';

function PremiumContent() {
  const {wallets} = useWallets();
  const {wrapFetchWithPayment} = useX402Fetch();

  async function fetchContent() {
    const fetchWithPayment = wrapFetchWithPayment({
      walletAddress: wallets[0]?.address,
      fetch
    });
    const response = await fetchWithPayment('https://api.example.com/premium');
    return response.json();
  }

  return <button onClick={fetchContent}>Fetch Premium Content</button>;
}
```

### Max Payment Protection (React)

Cap the maximum payment per request to prevent overspending:

```tsx
const fetchWithPayment = wrapFetchWithPayment({
  walletAddress: wallets[0].address,
  fetch,
  maxValue: BigInt(1000000) // Max 1 USDC (6 decimals)
});
```

### Node.js Integration (Server-Side)

```bash
npm i @privy-io/node @x402/fetch
```

```ts
import {PrivyClient} from '@privy-io/node';
import {createX402Client} from '@privy-io/node/x402';
import {wrapFetchWithPayment} from '@x402/fetch';

const privy = new PrivyClient({
  appId: process.env.PRIVY_APP_ID!,
  appSecret: process.env.PRIVY_APP_SECRET!
});

// Get or create agent wallet
const wallet = await privy.wallets().get({walletId: 'your-wallet-id'});

// Create x402 client from Privy wallet
const x402client = createX402Client(privy, {
  walletId: wallet.id,
  address: wallet.address
});

// Wrap fetch for automatic 402 handling
const fetchWithPayment = wrapFetchWithPayment(fetch, x402client);

// Use like normal fetch - 402 responses are handled transparently
const response = await fetchWithPayment('https://api.example.com/premium');
const data = await response.json();
```

### Requirements

- Users/agents need **USDC** in their Privy wallet on the correct network (Base, Base Sepolia, or Solana)
- The **facilitator** pays gas fees - users only need USDC, not ETH or SOL
- Testnet USDC: https://faucet.circle.com/

### x402 Facilitators

| Name | URL | Docs |
|------|-----|------|
| Pay AI | `https://facilitator.payai.network/` | https://docs.payai.network/x402/reference |
| Corbits | `https://facilitator.corbits.dev/` | htt

references/react-sdk.md

# React SDK Reference

Detailed reference for `@privy-io/react-auth` and related packages.

## Table of Contents

- [PrivyProvider Configuration](#privyprovider-configuration)
- [Core Hooks](#core-hooks)
- [Authentication Hooks](#authentication-hooks)
- [Wallet Hooks](#wallet-hooks)
- [Wagmi Integration](#wagmi-integration)
- [Viem Integration](#viem-integration)
- [Appearance & Theming](#appearance--theming)
- [Whitelabel Patterns](#whitelabel-patterns)
- [EVM Network Configuration](#evm-network-configuration)
- [App Clients](#app-clients)

## PrivyProvider Configuration

The `PrivyProvider` must wrap any component using Privy hooks. Render it as close to the root as possible.

### Props

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `appId` | `string` | Yes | Privy app ID from Dashboard |
| `clientId` | `string` | No | App client ID for multi-environment deployments |
| `config` | `PrivyClientConfig` | No | Configuration object |

### Full Config Shape

```tsx
import {PrivyProvider} from '@privy-io/react-auth';
import {toSolanaWalletConnectors} from '@privy-io/react-auth/solana';

<PrivyProvider
  appId="your-privy-app-id"
  clientId="your-client-id" // optional
  config={{
    // Login methods to enable
    loginMethods: ['email', 'sms', 'wallet', 'google', 'apple', 'twitter',
                   'github', 'discord', 'farcaster', 'telegram', 'passkey',
                   'linkedin', 'tiktok', 'spotify', 'instagram'],

    // Embedded wallet creation behavior
    embeddedWallets: {
      ethereum: {
        createOnLogin: 'users-without-wallets' // 'all-users' | 'off'
      },
      solana: {
        createOnLogin: 'users-without-wallets'
      }
    },

    // UI appearance
    appearance: {
      showWalletLoginFirst: false,
      walletChainType: 'ethereum-and-solana', // 'ethereum-only' | 'solana-only'
      theme: 'light', // 'dark' | custom theme object
      accentColor: '#6A6FF5',
      logo: 'https://your-logo.png',
      landingHeader: 'Welcome',
      loginMessage: 'Sign in to continue'
    },

    // External wallet connectors
    externalWallets: {
      solana: {
        connectors: toSolanaWalletConnectors()
      }
    },

    // Solana RPC config (needed for embedded wallet UIs)
    solana: {
      rpcs: {
        'solana:mainnet': {
          rpc: createSolanaRpc('https://api.mainnet-beta.solana.com'),
          rpcSubscriptions: createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com')
        }
      }
    },

    // Supported EVM chains
    supportedChains: [mainnet, base, arbitrum],
    defaultChain: base
  }}
>
  {children}
</PrivyProvider>
```

## Core Hooks

### usePrivy

Primary hook for auth state and user info.

```tsx
import {usePrivy} from '@privy-io/react-auth';

const {
  ready,          // boolean - SDK initialized
  authenticated,  // boolean - user is logged in
  user,           // PrivyUser | null
  login,          // () => void - opens login modal
  logout,       

Sponsored

Ads related to privy-integration and adjacent AI workflows.