Skip to main content
The React Native SDK supports email OTP and Google sign-in through OIDC ID-token auth or authorization-code redirect auth. Authentication returns an active wallet by default. Use manual wallet selection when your app should present wallet choices.

Create The Client

Create OMSClient before using authentication, wallet, signing, transaction, balance, or access APIs.
import { OMSClient } from '@0xsequence/oms-react-native-sdk'

const oms = new OMSClient({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
})
Parameters
ParameterTypeDescription
publishableKeystringPublishable key. The SDK selects the matching OMS Wallet environment from this key.
Returns Returns an OMSClient instance with wallet, indexer, and supportedNetworks.

Start Email Auth

Send a one-time code to the user’s email address.
await oms.wallet.startEmailAuth('user@example.com')
Parameters
ParameterTypeDescription
emailstringEmail address that receives the one-time code.
Returns Returns Promise<void>.

Complete Email Auth

Complete the flow with the code entered by the user. Automatic mode returns an active wallet when possible.
const result = await oms.wallet.completeEmailAuth({ code: '123456' })

if (result.type === 'walletSelected') {
  console.log('Wallet address:', result.walletAddress)
  console.log('Wallet ID:', result.wallet.id)
}
Use manual wallet selection when the app needs to choose between wallets before activating one.
const result = await oms.wallet.completeEmailAuth({
  code: '123456',
  walletSelection: 'manual',
  walletType: 'ethereum',
})

if (result.type === 'walletSelection') {
  await result.pendingSelection.createAndSelectWallet('main')
}
Parameters
ParameterTypeDescription
codestringOne-time code entered by the user.
walletSelection'automatic' or 'manual'Defaults to 'automatic'. Use 'manual' to receive a pending wallet selection.
walletType'ethereum' or undefinedOptional wallet type. Defaults to ethereum.
sessionLifetimeSecondsnumber, null, or undefinedOptional requested wallet API session lifetime in seconds. Defaults to one week.
Returns Returns Promise<OmsCompleteAuthResult>.
FieldTypeDescription
type'walletSelected' or 'walletSelection'Indicates whether a wallet was activated or manual selection is pending.
walletAddressstring or nullActive OMS Wallet address in automatic mode.
walletOmsWallet or nullSelected or created wallet in automatic mode.
walletsOmsWallet[]Wallets returned by auth completion.
credentialOmsCredentialInfoCredential added by auth completion.
pendingSelectionOmsPendingWalletSelection or undefinedManual wallet selection helper.

Sign In With OIDC ID Token

Authenticate with a Google ID token.
const result = await oms.wallet.signInWithOidcIdToken({
  idToken: 'OIDC_ID_TOKEN',
  issuer: 'https://accounts.google.com',
  audience: 'YOUR_WEB_CLIENT_ID',
  walletSelection: 'automatic',
  walletType: 'ethereum',
})

if (result.type === 'walletSelected') {
  console.log('Wallet address:', result.walletAddress)
}
Parameters
ParameterTypeDescription
idTokenstringGoogle ID token issued to the app.
issuerstringExpected token issuer, such as https://accounts.google.com.
audiencestringExpected token audience, such as the app’s Google client ID.
walletSelection'automatic' or 'manual'Defaults to 'automatic'. Use 'manual' to receive a pending wallet selection.
walletType'ethereum' or undefinedOptional wallet type. Defaults to ethereum.
sessionLifetimeSecondsnumber, null, or undefinedOptional requested wallet API session lifetime in seconds. Defaults to one week.
Returns Returns Promise<OmsCompleteAuthResult>.

OIDC Provider Config

Use OidcProviders.google to build the provider config for Google redirect auth.
import { OidcProviders } from '@0xsequence/oms-react-native-sdk'

const provider = OidcProviders.google({
  clientId: 'YOUR_WEB_CLIENT_ID',
})
Parameters
ParameterTypeDescription
clientIdstring or undefinedGoogle OAuth client ID. Defaults to the SDK’s configured Google client ID.
scopesstring[] or undefinedOAuth scopes. Defaults to openid, email, and profile.
authorizeParamsRecord<string, string> or undefinedExtra authorization query parameters.
Returns Returns OidcProviderConfig.

Start OIDC Redirect Auth

Start a Google authorization-code PKCE flow. Apps own browser opening and deep-link handling. Open the authorization URL in the platform system auth browser, then pass the resulting app-link URL to handleOidcRedirectCallback.
import { OidcProviders } from '@0xsequence/oms-react-native-sdk'

const started = await oms.wallet.startOidcRedirectAuth({
  provider: OidcProviders.google({ clientId: 'YOUR_WEB_CLIENT_ID' }),
  redirectUri: 'yourapp://oauth/callback',
  walletType: 'ethereum',
})

console.log('Open this URL with system auth UI:', started.authorizationUrl)

// When the app receives the callback URL from its deep-link handler:
const result = await oms.wallet.handleOidcRedirectCallback({
  callbackUrl: 'yourapp://oauth/callback?code=CODE&state=STATE',
})
Parameters
ParameterTypeDescription
providerOidcProviderConfigGoogle provider config returned by OidcProviders.google.
redirectUristringApp callback URL that receives the provider redirect. Configure this URL scheme or app link in your native app.
walletType'ethereum' or undefinedOptional wallet type. Defaults to ethereum.
authorizeParamsRecord<string, string> or nullExtra authorization query parameters.
loginHintstring, null, or undefinedOptional Google login_hint. When omitted for Google, the SDK can reuse the previous session email.
Returns Returns Promise<OmsStartOidcRedirectAuthResult>.
FieldTypeDescription
authorizationUrlstringProvider authorization URL to open with system auth UI.
statestringOIDC state value stored for callback validation.
challengestringWallet auth challenge used in the OIDC request.

Handle OIDC Redirect Callback

Complete redirect auth after the provider sends the user back to your app.
const result = await oms.wallet.handleOidcRedirectCallback({
  callbackUrl: 'com.example.app:/oauth/callback?code=CODE&state=STATE',
  walletSelection: 'manual',
})

if (result.type === 'walletSelection') {
  await result.pendingSelection.createAndSelectWallet('main')
}
Parameters
ParameterTypeDescription
callbackUrlstring, null, or undefinedFull callback URL containing OIDC code and state.
walletSelection'automatic' or 'manual'Defaults to 'automatic'. Use 'manual' to receive a pending wallet selection.
sessionLifetimeSecondsnumber, null, or undefinedOptional requested wallet API session lifetime in seconds. Defaults to one week.
Returns Returns Promise<OmsOidcRedirectAuthResult>.
Result typeDescription
completedRedirect auth completed and returned an active wallet.
walletSelectionAuth completed and manual wallet selection is pending.
notOidcRedirectCallbackThe URL was not an OIDC redirect callback for this SDK.
noPendingAuthThere is no pending redirect auth flow to complete.
failedRedirect auth failed and includes a message.

List Wallets

List wallets available to the authenticated credential.
const wallets = await oms.wallet.listWallets()

for (const wallet of wallets) {
  console.log(wallet.id, wallet.type, wallet.address)
}
Parameters Takes no parameters. Returns Returns Promise<OmsWallet[]>.

Use Wallet

Activate an existing wallet by server-side wallet ID.
const result = await oms.wallet.useWallet('wallet-id')

console.log('Wallet address:', result.walletAddress)
Parameters
ParameterTypeDescription
walletIdstringWallet ID returned by auth completion or listWallets.
Returns Returns Promise<OmsWalletActivationResult>.

Create Wallet

Create and activate a new wallet for the authenticated user.
const result = await oms.wallet.createWallet({
  walletType: 'ethereum',
  reference: 'main',
})

console.log('New wallet:', result.walletAddress)
Parameters
ParameterTypeDescription
walletType'ethereum' or undefinedWallet type to create. Defaults to ethereum.
referencestring, null, or undefinedOptional app-defined wallet reference.
Returns Returns Promise<OmsWalletActivationResult>.