> ## 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 @polygonlabs/oms-wallet viem
    ```
  </Tab>

  <Tab title="React Native">
    ```bash theme={null}
    pnpm add @polygonlabs/oms-wallet-react-native
    ```
  </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
    ```

    Use the dependency rule **Up to Next Major Version** with version `0.3.0`.
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    dependencies {
        implementation("io.github.0xsequence:oms-wallet-kotlin-sdk:0.3.0")
    }
    ```
  </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 { OMSWallet } from '@polygonlabs/oms-wallet'

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

  <Tab title="React Native">
    ```typescript theme={null}
    import { OMSWallet } from '@polygonlabs/oms-wallet-react-native'

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

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

    let omsWallet = try OMSWallet(publishableKey: "YOUR_PUBLISHABLE_KEY")
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    import technology.polygon.omswallet.OMSWallet

    val omsWallet = OMSWallet(
        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 omsWallet.wallet.startEmailAuth({ email: 'user@example.com' })

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

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

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

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

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

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

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

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

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

  <Tab title="Kotlin">
    Kotlin wallet APIs are `suspend` functions. Call them from a coroutine, such as `lifecycleScope.launch` in an Android UI.

    ```kotlin theme={null}
    import technology.polygon.omswallet.wallet.CompleteAuthResult

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

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

    println("Wallet address: ${result.wallet.address}")
    ```
  </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 '@polygonlabs/oms-wallet'
    import { parseEther, type Address } from 'viem'

    const recipient = '0x1111111111111111111111111111111111111111' as Address

    const tx = await omsWallet.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}
    import { Networks } from '@polygonlabs/oms-wallet-react-native'

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

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

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

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

  <Tab title="Kotlin">
    ```kotlin theme={null}
    import technology.polygon.omswallet.Network
    import java.math.BigInteger

    val tx = omsWallet.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>
