> **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 Adapter

The Privy adapter is for React apps that want Privy to own authentication, session state, and embedded wallets while plugging into Tempo account features. Use `privy` from `accounts/react/privy`; it wires Privy's hooks into the Accounts SDK and signs through Privy's embedded Ethereum provider.

Use it when you want:

* Privy to own app authentication and embedded wallets.
* Your React app to keep using Privy's hosted login UI.
* Tempo account features backed by Privy's raw `secp256k1_sign` embedded-wallet signer.

## Usage

Wrap your app with `PrivyProvider`, configure embedded Ethereum wallet creation, and mount `PrivyAccountsBridge` inside the same React tree. Then create the provider with `privy()`.

:::code-group
```tsx [main.tsx]
import { PrivyProvider } from '@privy-io/react-auth'
import { PrivyAccountsBridge } from 'accounts/react/privy'
import { createRoot } from 'react-dom/client'

import { App } from './App.js'

createRoot(document.getElementById('root')!).render(
  <PrivyProvider
    appId={import.meta.env.VITE_PRIVY_APP_ID}
    config={{
      embeddedWallets: {
        ethereum: { createOnLogin: 'users-without-wallets' },
      },
    }}
  >
    <PrivyAccountsBridge />
    <App />
  </PrivyProvider>,
)
```

```ts [provider.ts]
import { Provider } from 'accounts'
import { privy } from 'accounts/react/privy'

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

:::tip
`PrivyAccountsBridge` is a React boundary. It exists because Privy's `usePrivy`, `useWallets`, and `useLogin` hooks can only run under `PrivyProvider`, while the Accounts SDK provider is plain TypeScript.
:::

## Account Behavior

With `privy()`, all embedded Ethereum wallets on the Privy user are connected. Privy does not expose secp256k1 public keys for embedded Ethereum wallets, so the adapter cannot construct a `viem/tempo` `Account` directly from the connected Privy account. Instead, it signs Tempo payloads through Privy's embedded Ethereum provider with `secp256k1_sign`.

The first embedded Ethereum wallet returned by Privy is active by default.

## Implementation Note

The public Privy integration lives at `accounts/react/privy`. Internally, it wraps the lower-level Privy adapter with a hook-backed client so app code does not need to manage a separate adapter bridge.

## Next Steps

[privy reference](/docs/api/privy): Full API reference for the React Privy adapter.
