> ## 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, authenticate a wallet, and send a Polygon Amoy transaction.

This quickstart creates an active wallet with email OTP and submits a zero-value transaction on Polygon Amoy.

## Install the SDK

```bash theme={null}
pnpm add @polygonlabs/oms-wallet
```

The package supports browser applications and Node.js 22 or newer.

## Create the client

```typescript theme={null}
import { OMSWallet } from '@polygonlabs/oms-wallet'

export const omsWallet = new OMSWallet({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
})
```

`OMSWallet` exposes two clients with different state models:

* `omsWallet.wallet` holds one active wallet session. Authentication, transactions, and signing use this stateful client.
* `omsWallet.indexer` is an independent read-only client. It can query any address without an active wallet session.

## Authenticate with email OTP

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

// Collect the code in your application's OTP form.
const session = await omsWallet.wallet.completeEmailAuth({ code: '123456' })

console.log('Active wallet:', session.walletAddress)
```

The default automatic selection activates the first existing Ethereum wallet or creates and activates one when none exists. The browser client persists the completed session so a later `OMSWallet` instance can restore it.

## Send a test transaction

```typescript theme={null}
import { Networks } from '@polygonlabs/oms-wallet'

const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.amoy,
  to: '0x1111111111111111111111111111111111111111',
  value: 0n,
})

console.log('OMS transaction:', transaction.txnId)
console.log('Status:', transaction.status)
console.log('Transaction hash:', transaction.txnHash)
```

`sendTransaction` prepares, executes, and waits up to 60 seconds by default for a transaction hash or terminal status. `txnHash` remains optional because submission status can still be unresolved when the wait ends.

Continue with [authentication](/wallets/sdk/typescript/authentication) for Google, Apple, custom OIDC, and manual wallet selection. See [send transactions](/wallets/sdk/typescript/send-transactions) for contract calls, fee behavior, and status handling.
