> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK Quickstart

> Install the TypeScript OMS Wallet SDK, create a client, and authenticate a wallet with email OTP.

`OMSClient` is the TypeScript entry point for wallet auth, transactions, message signing, and balance queries. Use the SDK `Networks` registry for network arguments and viem helpers for EVM values such as `Address`, `Abi`, and raw base-unit `bigint` amounts.

## Install

Install the published SDK package. The quickstart examples also use `viem` helpers such as `parseEther`, `Address`, and typed ABI definitions, so install it as a direct dependency too.

```bash theme={null}
pnpm add @0xsequence/typescript-sdk viem
```

For npm or yarn projects:

```bash theme={null}
npm install @0xsequence/typescript-sdk viem
yarn add @0xsequence/typescript-sdk viem
```

## Create The Client

```typescript theme={null}
import { OMSClient } from '@0xsequence/typescript-sdk'

const oms = new OMSClient({
  publishableKey: 'YOUR_PROJECT_ACCESS_KEY',
  projectId: 'YOUR_PROJECT_ID',
})
```

The client exposes:

| Property                | Use                                                                                            |
| ----------------------- | ---------------------------------------------------------------------------------------------- |
| `oms.wallet`            | Authentication, session state, wallet selection, message signing, ID tokens, and transactions. |
| `oms.indexer`           | Token balance reads.                                                                           |
| `oms.supportedNetworks` | Networks supported by this SDK build.                                                          |

## Authenticate With Email

Email auth is a two-step OTP flow.

```typescript theme={null}
await oms.wallet.startEmailAuth({ email: 'user@example.com' })

// Show your OTP input, then complete auth with the user-entered code.
const { walletAddress } = await oms.wallet.completeEmailAuth({ code: '123456' })

console.log('Wallet address:', walletAddress)
```

`completeEmailAuth` verifies the OTP, loads an existing wallet for the user, or creates one when needed.

## Send A Transaction

After authentication, send a native token transaction with `oms.wallet.sendTransaction`. Values are raw base-unit `bigint` values.

On testnets, fee options are automatically sponsored, so Polygon Amoy is a good first network for testing.

```typescript theme={null}
import { Networks } from '@0xsequence/typescript-sdk'
import { parseEther, type Address } from 'viem'

const recipient = '0xRecipient' as Address

const tx = await oms.wallet.sendTransaction({
  network: Networks.amoy,
  to: recipient,
  value: parseEther('0'),
})

console.log('Transaction:', tx.txnHash ?? tx.txnId)
```
