> ## 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, configure native clients, and authenticate a wallet with email OTP.

The React Native SDK wraps the native OMS Wallet SDKs for iOS and Android. It exposes module-level functions for wallet auth, session state, signing, transactions, ID tokens, access management, balance reads, and unit conversion.

## Install

Install the React Native wrapper package from npm. The wrapper includes the native iOS and Android projects that React Native autolinking consumes from `node_modules`.

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

For npm or yarn projects:

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

Do not add the underlying native SDKs directly. Android resolves `io.github.0xsequence:oms-client-kotlin-sdk:0.1.0-alpha.1` from Maven, and iOS resolves `oms-client-swift-sdk` `0.1.0-alpha.1` from CocoaPods through the wrapper package.

Bare React Native apps are supported through normal autolinking. Expo apps need a development build, Expo prebuild/EAS Build, or the bare workflow because Expo Go cannot load custom native code.

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.

## Configure The SDK

Call `configure` once before using wallet, signing, transaction, balance, or access APIs.

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

await configure({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
  projectId: 'YOUR_PROJECT_ID',
})
```

The package exposes:

| API Area           | Use                                                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Authentication     | Email OTP, OIDC ID-token auth, OIDC redirect auth, wallet selection, and wallet creation.                                                  |
| Session            | Wallet address lookup, session metadata, ID tokens, access management, and sign out.                                                       |
| Blockchain         | Supported-network listing, native token transactions, contract calls, signing, verification, fee selection, and transaction status checks. |
| Balances & History | Token balance and native token balance reads.                                                                                              |
| Unit helpers       | `parseUnits` and `formatUnits` for raw base-unit string conversion.                                                                        |

## Authenticate With Email

Email auth is a two-step OTP flow.

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

await startEmailAuth('user@example.com')

// Show your OTP input, then complete auth with the user-entered code.
const result = await 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 underlying native SDKs.

## Send A Transaction

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

On testnets, fee options are automatically sponsored, so Polygon Amoy is a good first network for testing.

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

const tx = await sendTransaction({
  chainId: '80002',
  to: '0xRecipient',
  value: '0',
})

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