Skip to main content
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@0.1.0-alpha.4 viem
For npm or yarn projects:
npm install @0xsequence/typescript-sdk@0.1.0-alpha.4 viem
yarn add @0xsequence/typescript-sdk@0.1.0-alpha.4 viem

Create The Client

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

const oms = new OMSClient({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
})
The publishableKey selects the matching OMS Wallet environment for client SDK calls. The client exposes:
PropertyUse
oms.walletAuthentication, session state, wallet selection, message signing, ID tokens, and transactions.
oms.indexerToken balance and transaction history 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. Polygon Amoy is a good first network for testing.
import { Networks } from '@0xsequence/typescript-sdk'
import { parseEther, type Address } from 'viem'

const recipient = '0x1111111111111111111111111111111111111111' as Address

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

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