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

# React Native SDK Quickstart

> Install the React Native OMS Wallet SDK, create a client, and authenticate a wallet with email OTP.

`OMSClient` is the React Native entry point for wallet auth, session state, signing, transactions, ID tokens, access management, balance reads, and transaction history. The package also exports unit-conversion helpers.

## Install

Install the React Native package from npm. React Native autolinking connects the included native modules from `node_modules`.

```bash theme={null}
pnpm add @0xsequence/oms-react-native-sdk@0.1.0-alpha.4
```

For npm or yarn projects:

```bash theme={null}
npm install @0xsequence/oms-react-native-sdk@0.1.0-alpha.4
yarn add @0xsequence/oms-react-native-sdk@0.1.0-alpha.4
```

Do not add platform SDKs separately. For iOS, run `pod install` from the `ios` directory, or run `npx pod-install`, after installing the package.

React Native CLI apps are supported through autolinking. Expo Go is not supported; use an Expo development build, such as one created with prebuild or EAS Build.

Android apps need `minSdk 26`, `compileSdk 34` or newer, and Java 17 compile options. iOS apps need deployment target 15.0 or newer. OIDC redirect auth also requires the app to configure its own URL scheme or app links.

## Create The Client

Create one `OMSClient` when your app starts and reuse it for wallet operations.

```typescript theme={null}
import { OMSClient } from '@0xsequence/oms-react-native-sdk'

const oms = new OMSClient({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
})
```

The `publishableKey` selects the matching OMS Wallet environment for client SDK calls.

The client exposes:

| Property                | Use                                                                                                                               |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `oms.wallet`            | Authentication, session state, wallet selection, signing, signature verification, ID tokens, access management, and transactions. |
| `oms.indexer`           | Token balance and transaction history reads.                                                                                      |
| `oms.supportedNetworks` | Networks supported by this SDK build.                                                                                             |

Top-level `parseUnits` and `formatUnits` helpers are also exported for raw base-unit string conversion.

## Authenticate With Email

Email auth is a two-step OTP flow.

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

// Show your OTP input, then complete auth with the user-entered code.
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)
```

`completeEmailAuth` verifies the OTP, loads an existing wallet for the user, or creates one when needed. Wallet metadata and session state are persisted by the SDK.

## Send A Transaction

After authentication, send a native token transaction with `oms.wallet.sendTransaction`. Values are raw base-unit integer strings.

Polygon Amoy is a good first network for testing.

```typescript theme={null}
const tx = await oms.wallet.sendTransaction({
  chainId: '80002',
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
})

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