# Use the Tempo Accounts SDK

## Overview

The [Tempo Accounts SDK](https://accounts.tempo.xyz/docs) is a TypeScript library for letting
users connect a Tempo account (a hosted Tempo Wallet, a domain-bound passkey, and more) to your
application. It exposes a `Provider` that you pass to [`createClient`](/tempo) as a transport,
so you can connect an account and then drive it with the same
[Viem](/tempo) and [Tempo Actions](/tempo/actions) used throughout these guides.

This guide covers the vanilla **Provider + Viem** path. For the Wagmi/React connectors,
signing adapters, and server handlers, see the
[Tempo Accounts SDK docs](https://accounts.tempo.xyz/docs).

## Setup

::::steps
### Install the SDK

The Tempo Accounts SDK is published as the [`accounts`](https://www.npmjs.com/package/accounts)
package.

:::code-group
```bash [npm]
npm i accounts
```

```bash [pnpm]
pnpm i accounts
```

```bash [bun]
bun i accounts
```
:::

### Connect an Account

Create a `Provider`, then prompt the user to connect with the `wallet_connect` JSON-RPC method.

```ts
import { Provider } from 'accounts'

const provider = Provider.create()

const { accounts } = await provider.request({
  method: 'wallet_connect',
})
```

### Get a Viem Client

Create a Tempo client with [`createClient`](/tempo), passing the connected `provider` as its
transport. The client comes preconfigured with the Tempo Actions namespaces.

```ts
import { Provider } from 'accounts'
import { createClient, custom } from 'viem/tempo'

const provider = Provider.create()

const client = createClient({
  transport: custom(provider),
})
```

### Send a Payment

Use the connected client with any Viem or Tempo Action, such as
[`token.transfer`](/tempo/actions/token.transfer) to send a stablecoin payment.

```ts
import { parseUnits } from 'viem'

const { receipt } = await client.token.transferSync({
  amount: parseUnits('10', 6),
  token: '0x20c0000000000000000000000000000000000001',
  to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb',
})
```
::::

## Best Practices

### Choose the Right Integration

Use the **Provider + Viem** path shown here for vanilla TypeScript, scripts, and non-React
apps. For React, the SDK ships Wagmi connectors (`tempoWallet` and `webAuthn`) that handle
connection state for you. See the
[Tempo Accounts SDK docs](https://accounts.tempo.xyz/docs) to choose an adapter.

### Review the Production Checklist

Before shipping, work through the SDK's
[Deploying to Production](https://accounts.tempo.xyz/docs/production) guide for origin
configuration, key custody, and fee sponsorship considerations.

## See More

<Cards>
  <Card icon="lucide:send" title="Tempo Transactions" description="Send Tempo Transactions and discover the payment features they unlock." to="/tempo/transactions" />

  <Card icon="lucide:square-function" title="Tempo Actions" description="The full reference for every Tempo Action you can call on the client." to="/tempo/actions" />

  <Card icon="lucide:book-open" title="Tempo Accounts SDK" description="The complete SDK docs, adapters, and framework integrations." to="https://accounts.tempo.xyz/docs" />
</Cards>
