<!-- tempo-docs-context -->
> Source: [/docs/zones/connect](https://tempo.xyz/developers/docs/zones/connect.md)
> Section: [Zones](https://tempo.xyz/developers/docs/zones.md). Connect to a Zone and work with private balances, deposits, and withdrawals. Zones is in limited preview; see the introduction for access. Earlier testnet sandbox guides describe a separate integration.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

<span id="connect-to-a-zone" />

# Connect to a Zone

Authenticate your application's access to one Zone deployment.

## Overview

Connecting gives your application authenticated access to one Zone deployment. You get the deployment details from the operator, sign an authorization token, and check the chain ID. A Zone runs its own network and chain ID. It isn't a privacy setting on a Tempo account.

This page assumes you have a [Tempo account signer](https://tempo.xyz/developers/docs/accounts/keys). The Viem and Wagmi examples import `zoneChain` and `zoneConfig` from [Client Setup](https://tempo.xyz/developers/docs/zones/examples).

<span id="configure-the-zone-connection" />

## Setup

::::steps
<span id="confirm-the-integration-interfaces" />

<span id="get-connection-details" />

<span id="check-supported-operations" />

<span id="supported-operations" />

### Get the Deployment Details

Get the configuration from the operator, or [contact Tempo](https://tempo.xyz/contact). Ask for the Zone RPC endpoint, chain ID, Zone ID, portal address, and enabled assets. Also ask for the supported SDK or contract interfaces and the endpoint access credentials.

Confirm three controls separately with the operator or your wallet provider:

| Control | Confirm before integrating |
| --- | --- |
| **Signing authority** | Which account keys or provider interface sign deposits and withdrawals. |
| **Read access** | Which credentials let your application read balances and activity, and which accounts they expose. |
| **Funding rules** | Which assets, depositors, withdrawal recipients, refunds, and callbacks the deployment permits. |

A Zone RPC connection alone doesn't establish all three. If you use a hosted provider, confirm its authentication and data-scoping rules. These steps use the account-scoped, redacted Zone RPC. Operator RPC is a separate interface.

Confirm which operations the deployment enables before you move an existing application into a Zone. The current permissioned runtime moves tokens only through deposits and withdrawals. It disables general TIP-20 transfer calls and user contract deployment, as the [execution rules](https://tempo.xyz/developers/docs/protocol/zones/execution) describe.

<span id="authenticate-the-account" />

<span id="authenticate-rpc-requests" />

### Authorize Access

An authorization token is a signed credential that proves control of the account. Sign it with the account key. Send it in the `X-Authorization-Token` header on every Zone RPC request. The token authenticates RPC requests. It doesn't replace transaction signatures or the credentials required to reach the endpoint.

With Viem, sign with your account and the Zone chain from [Client Setup](https://tempo.xyz/developers/docs/zones/examples). Set `ZONE_ID` to the operator-provided Zone ID. This code signs locally. It doesn't submit a transaction.

```ts [Viem]
import { createClient } from 'viem/tempo'
import { zoneChain } from './zone.config'
const client = createClient({ account, chain: zoneChain })
const { token } = await client.zone.signAuthorizationToken({
  zoneId: Number(process.env.ZONE_ID),
  expiresAt: Math.floor(Date.now() / 1000) + 3600,
})
```

Use the returned `token` as `ZONE_AUTH_TOKEN`. Keep it private and renew it before expiry. Other signers must follow the [authorization token format](https://tempo.xyz/developers/docs/protocol/zones/rpc#authorization-tokens). Confirm the operator's maximum token lifetime.

<span id="confirm-the-network" />

### Check the Connection

Set `ZONE_RPC_URL` to the deployment's endpoint and `ZONE_AUTH_TOKEN` to the signed token. TypeScript uses `viem` (`pnpm add viem`). Python uses `requests` (`pip install requests`). CLI examples use [Foundry](https://tempo.xyz/developers/docs/sdk/foundry).

These examples run on your backend. The Wagmi example uses core actions with `zoneConfig`. Keep shared operator credentials out of browser code.

:::code-group
```ts [Viem]
import { createPublicClient, http } from 'viem'
import { tempoActions } from 'viem/tempo'
const zone = createPublicClient({
  transport: http(process.env.ZONE_RPC_URL, {
    fetchOptions: { headers: { 'X-Authorization-Token': process.env.ZONE_AUTH_TOKEN! } },
  }),
}).extend(tempoActions())
console.log(await zone.getChainId())
```

```ts [Wagmi]
import { getPublicClient } from '@wagmi/core'
import { zoneConfig } from './zone.config'
const chainId = await getPublicClient(zoneConfig)!.getChainId()
```

```python [Python]
import os, requests
zone_rpc_url = os.environ["ZONE_RPC_URL"]
zone = requests.Session()
zone.headers["X-Authorization-Token"] = os.environ["ZONE_AUTH_TOKEN"]
response = zone.post(zone_rpc_url, json={
    "jsonrpc": "2.0", "id": 1, "method": "eth_chainId", "params": []
})
response.raise_for_status()
print(response.json())
```

```bash [CLI]
cast chain-id --rpc-url "$ZONE_RPC_URL" \
  --rpc-headers "X-Authorization-Token: $ZONE_AUTH_TOKEN"
```
:::

Reuse `zone` in the TypeScript and Python [balance examples](https://tempo.xyz/developers/docs/zones/balances). For raw RPC responses, check for an `error` before you use `result`. A successful HTTP request can contain a JSON-RPC error.

Compare the returned chain ID with the operator-provided configuration. Keep separate clients for public Tempo and the Zone's private ledger. Use the correct chain ID when you prepare signatures and calls.
::::

## Related

[Client Setup](https://tempo.xyz/developers/docs/zones/examples): Use for configuring the Zone chain and Wagmi client that the guides import.

[RPC Reference](https://tempo.xyz/developers/docs/protocol/zones/rpc): Covers per-account scoping, response redaction, and the authorization token format.

[Connect to the Sandbox](https://tempo.xyz/developers/docs/guide/private-zones/connect-to-a-zone): Use for trying the connection with test funds in the testnet sandbox.

[Deposit Into a Zone](https://tempo.xyz/developers/docs/zones/deposit): Use for funding the private account through the portal on Tempo.

[Testnet Sandbox](https://tempo.xyz/developers/docs/guide/private-zones): Covers the earlier testnet deployment and how it differs from current deployments.
