Skip to main content

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.

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.
pnpm add @0xsequence/typescript-sdk@alpha viem
For npm or yarn projects:
npm install @0xsequence/typescript-sdk@alpha viem
yarn add @0xsequence/typescript-sdk@alpha viem

Create The Client

import { OMSClient } from '@0xsequence/typescript-sdk'

const oms = new OMSClient({
  publicApiKey: 'YOUR_PROJECT_ACCESS_KEY',
  projectId: 'YOUR_PROJECT_ID',
})
The client exposes:
PropertyUse
oms.walletAuthentication, session state, wallet selection, message signing, ID tokens, and transactions.
oms.indexerToken balance reads.
oms.supportedNetworksNetworks supported by this SDK build.

Authenticate With Email

Email auth is a two-step OTP flow.
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.
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)