> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://accounts.tempo.xyz/api/mcp` to find what you need.

# `privy`

Creates a Privy adapter for React apps using `@privy-io/react-auth`.

Import it from `accounts/react/privy`. The adapter opens Privy's login UI through a React boundary, reads Privy's hook state, and returns embedded Ethereum wallets to the Accounts SDK. Privy does not expose secp256k1 public keys for embedded Ethereum wallets, so the adapter signs Tempo payloads through Privy's embedded provider with `secp256k1_sign`.

## Usage

```ts
import { Provider } from 'accounts'
import { privy } from 'accounts/react/privy'

export const provider = Provider.create({
  adapter: privy(),
})
```

The helper expects `PrivyAccountsBridge` under `PrivyProvider`:

```tsx
import { PrivyProvider } from '@privy-io/react-auth'
import { PrivyAccountsBridge } from 'accounts/react/privy'

root.render(
  <PrivyProvider appId={appId}>
    <PrivyAccountsBridge />
    <App />
  </PrivyProvider>,
)
```

The bridge resolves connect requests with Privy's embedded Ethereum wallets.

## Parameters

### icon

* **Type:** `` `data:image/${string}` ``
* **Optional**

Data URI of the provider icon.

```ts
import { Provider } from 'accounts'
import { privy } from 'accounts/react/privy'

const provider = Provider.create({
  adapter: privy({
    icon: 'data:image/svg+xml,...', // [!code focus]
  }),
})
```

### name

* **Type:** `string`
* **Default:** `'Privy'`

Display name of the provider.

```ts
import { Provider } from 'accounts'
import { privy } from 'accounts/react/privy'

const provider = Provider.create({
  adapter: privy({
    name: 'My Wallet', // [!code focus]
  }),
})
```

### rdns

* **Type:** `string`
* **Default:** `'io.privy'`

Reverse DNS identifier.

```ts
import { Provider } from 'accounts'
import { privy } from 'accounts/react/privy'

const provider = Provider.create({
  adapter: privy({
    rdns: 'com.example.wallet', // [!code focus]
  }),
})
```

## PrivyAccountsBridge

`PrivyAccountsBridge` is a null-rendering React component. Mount it under `PrivyProvider` and inside the same React tree as the app that creates or uses the Accounts SDK provider.

It exists because Privy's `usePrivy`, `useWallets`, and `useLogin` hooks can only run inside `PrivyProvider`, while the Accounts SDK provider is plain TypeScript.

## Account Behavior

The public React adapter connects all embedded Ethereum wallets returned by Privy. During connect, the bridge returns those wallet addresses to the internal adapter.

The internal adapter materializes each embedded wallet provider with Privy's SDK and signs with `provider.request({ method: 'secp256k1_sign', params: [hash] })`.

Because Privy does not expose the Ethereum wallet public key, the adapter does not construct a `viem/tempo` `Account` directly from the connected Privy account.
