Skip to main content
Use the React Native SDK session APIs after creating OMSClient to restore wallet state, issue ID tokens, and manage wallet access. Completed wallet sessions are persisted between app launches.

Get Wallet Address

Read the active wallet address after client creation and session restore.
const walletAddress = await oms.wallet.getWalletAddress()

if (walletAddress) {
  console.log('Restored wallet:', walletAddress)
}
Parameters Takes no parameters. Returns Returns Promise<string | null>.

Get Session

Read completed wallet-session metadata.
const session = await oms.wallet.getSession()

console.log(session.walletAddress, session.expiresAt, session.loginType)
Parameters Takes no parameters. Returns Returns Promise<OmsClientSessionState>.
FieldTypeDescription
walletAddressstring or nullActive wallet address, when a session is restored.
expiresAtstring or nullSession expiration timestamp.
loginType'Email', 'GoogleAuth', 'Oidc', or nullLogin method for the session.
sessionEmailstring or nullEmail address associated with the session when available.

On Session Expired

Subscribe to wallet session expiration events. The listener receives the expired session snapshot so your app can route the user back to sign-in or prefill re-authentication UI.
const subscription = oms.wallet.onSessionExpired((event) => {
  console.log('Session expired at:', event.expiredAt)
  console.log('Expired wallet:', event.session.walletAddress)
})
Keep the subscription active while the screen or service needs updates. Call subscription.remove() when that owner is disposed. Parameters
ParameterTypeDescription
listener(event: OmsClientSessionExpiredEvent) => voidCallback invoked when the active wallet session expires.
Returns Returns { remove(): void }.
FieldTypeDescription
sessionOmsClientSessionStateExpired session snapshot.
expiredAtstringExpiration event timestamp.

Get ID Token

Request an ID token for the active wallet session. Send this token to your backend when using backend wallet verification.
const idToken = await oms.wallet.getIdToken({
  ttlSeconds: 300,
})
Parameters
ParameterTypeDescription
ttlSecondsnumber, null, or undefinedOptional token lifetime in seconds.
customClaimsRecord<string, unknown>, null, or undefinedOptional app-provided claims. Backends should treat them as client-provided context unless they control the values.
Returns Returns Promise<string>.

List Access

List wallet access grants for account-management UI.
const credentials = await oms.wallet.listAccess({ pageSize: 25 })

for (const credential of credentials) {
  console.log(credential.credentialId, credential.expiresAt, credential.isCaller)
}
Parameters
ParameterTypeDescription
pageSizenumber, null, or undefinedOptional page size for paginated access results.
Returns Returns Promise<OmsCredentialInfo[]>.

List Access Pages

Use listAccessPages when your UI should render credential access one page at a time.
for await (const page of oms.wallet.listAccessPages({ pageSize: 25 })) {
  for (const credential of page.credentials) {
    console.log(credential.credentialId, credential.isCaller)
  }
}
Parameters
ParameterTypeDescription
pageSizenumber, null, or undefinedOptional page size for each access-list request.
Returns Returns AsyncGenerator<OmsListAccessResponse, void, void>.

List Access Page

Fetch one credential access page with an optional cursor.
const page = await oms.wallet.listAccessPage({
  pageSize: 25,
  cursor: null,
})

console.log('Credential count:', page.credentials.length)
Parameters
ParameterTypeDescription
pageSizenumber, null, or undefinedOptional page size for this access-list request.
cursorstring, null, or undefinedCursor returned by a previous page.
Returns Returns Promise<OmsListAccessResponse>.
FieldTypeDescription
credentialsOmsCredentialInfo[]Credentials returned for the page.
pageOmsAccessPage or nullPagination metadata, including limit and next cursor.

Revoke Access

Revoke another credential’s access to the active wallet.
await oms.wallet.revokeAccess('credential-id')
Parameters
ParameterTypeDescription
targetCredentialIdstringCredential ID returned by listAccess.
Returns Returns Promise<void>.

Sign Out

Clear the active wallet session.
await oms.wallet.signOut()
Parameters Takes no parameters. Returns Returns Promise<void>.