> ## 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.

# SDK Quickstart

> Install an OMS Wallet SDK, authenticate a non-custodial wallet, and send a first transaction.

This quickstart walks through the minimum OMS Wallet SDK flow: install an SDK, create the client, authenticate with email OTP, and send a first transaction from the non-custodial wallet.

<Note>
  TypeScript is for web, Node, and JavaScript apps. React Native is for iOS and Android apps using React Native, including Expo development builds and bare apps. Swift and Kotlin are native app SDKs.
</Note>

## 1. Get a publishable key

Contact us to have your publishable key manually provisioned before getting started. SDK constructors pass this value as `publishableKey`, which selects the matching OMS Wallet environment for client SDK calls.

## 2. Install an SDK

<Tabs>
  <Tab title="TypeScript">
    ```bash theme={null}
    pnpm add @0xsequence/typescript-sdk viem
    ```
  </Tab>

  <Tab title="React Native">
    ```bash theme={null}
    pnpm add @0xsequence/oms-react-native-sdk@0.1.0-alpha.3
    ```
  </Tab>

  <Tab title="Swift">
    Add the package in Xcode with **File -> Add Package Dependencies** and enter the following git URL.

    ```
    https://github.com/0xsequence/swift-sdk.git
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    dependencies {
        implementation("io.github.0xsequence:oms-client-kotlin-sdk:0.1.0-alpha.3")
    }
    ```
  </Tab>
</Tabs>

## 3. Create the client

Create the client once when your app starts, then reuse it for wallet operations.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import { OMSClient } from '@0xsequence/typescript-sdk'

    const oms = new OMSClient({
      publishableKey: 'YOUR_PUBLISHABLE_KEY',
    })
    ```
  </Tab>

  <Tab title="React Native">
    ```typescript theme={null}
    import { OMSClient } from '@0xsequence/oms-react-native-sdk'

    const oms = new OMSClient({
      publishableKey: 'YOUR_PUBLISHABLE_KEY',
    })
    ```
  </Tab>

  <Tab title="Swift">
    ```swift theme={null}
    import OMS_SDK

    let oms = try OMSClient(publishableKey: "YOUR_PUBLISHABLE_KEY")
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    import com.omsclient.kotlin_sdk.OMSClient

    val client = OMSClient(
        context = context,
        publishableKey = "YOUR_PUBLISHABLE_KEY",
    )
    ```
  </Tab>
</Tabs>

## 4. Authenticate with email

Email authentication is a two-step OTP flow. Start auth, show your OTP input, then complete auth with the user-entered code.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    await oms.wallet.startEmailAuth({ email: 'user@example.com' })

    const { walletAddress } = await oms.wallet.completeEmailAuth({ code: '123456' })

    console.log('Wallet address:', walletAddress)
    ```
  </Tab>

  <Tab title="React Native">
    ```typescript theme={null}
    await oms.wallet.startEmailAuth('user@example.com')

    const result = await oms.wallet.completeEmailAuth({ code: '123456' })

    if (result.type !== 'walletSelected') {
      throw new Error('Select or create a wallet before continuing')
    }

    console.log('Wallet address:', result.walletAddress)
    ```
  </Tab>

  <Tab title="Swift">
    ```swift theme={null}
    try await oms.wallet.startEmailAuth(email: "user@example.com")

    let result = try await oms.wallet.completeEmailAuth(code: "123456")

    if case let .walletSelected(walletAddress, _, _, _) = result {
        print("Wallet address:", walletAddress)
    }
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    import com.omsclient.kotlin_sdk.wallet.CompleteAuthResult

    client.wallet.startEmailAuth("user@example.com")

    val result = client.wallet.completeEmailAuth("123456")
    check(result is CompleteAuthResult.WalletSelected)

    println("Wallet address: ${result.walletAddress}")
    ```
  </Tab>
</Tabs>

## 5. Send a first transaction

Send a native token transaction on Polygon Amoy. Values are raw base-unit values.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    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)
    ```
  </Tab>

  <Tab title="React Native">
    ```typescript theme={null}
    const tx = await oms.wallet.sendTransaction({
      chainId: '80002',
      to: '0x1111111111111111111111111111111111111111',
      value: '0',
    })

    console.log('Transaction:', tx.txnHash ?? tx.txnId)
    ```
  </Tab>

  <Tab title="Swift">
    ```swift theme={null}
    let tx = try await oms.wallet.sendTransaction(
        network: .polygonAmoy,
        to: "0x1111111111111111111111111111111111111111",
        value: "0"
    )

    print("Transaction:", tx.txnHash ?? tx.txnId)
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    import com.omsclient.kotlin_sdk.Network
    import java.math.BigInteger

    val tx = client.wallet.sendTransaction(
        network = Network.AMOY,
        to = "0x1111111111111111111111111111111111111111",
        value = BigInteger.ZERO,
    )

    println("Transaction id: ${tx.txnId}")
    println("Transaction hash: ${tx.txnHash}")
    ```
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="SDK Overview" icon="book-open" href="/wallets/sdk/overview">
    Compare available SDKs and find the detailed reference for each one.
  </Card>

  <Card title="Send USDC" icon="arrow-right-arrow-left" href="/wallets/sdk/guides/send-usdc">
    Send an ERC-20 transfer from a non-custodial wallet.
  </Card>

  <Card title="SDK Authentication" icon="key" href="/wallets/sdk/overview">
    Choose your SDK, then open its Authentication page for wallet selection and wallet creation.
  </Card>

  <Card title="Balances & History" icon="coins" href="/wallets/sdk/overview">
    Choose your SDK, then open its Balances & History page for indexer reads.
  </Card>
</CardGroup>
