stablyai/orca · error · Error

Orca Relay credentials require a native secret store

Error message

Orca Relay credentials require a native secret store

What it means

Thrown by `requireNativeSecretStore` in the relay credential bundle module when `Platform.OS === 'web'`. Orca Relay credentials live in the device's native SecureStore (Keychain/Keystore); the web target has no equivalent, so read/write of a bundle is refused rather than silently persisting to insecure browser storage.

Source

Thrown at mobile/src/transport/mobile-relay-credential-bundle.ts:108

export async function writeMobileRelayCredentialBundle(
  bundle: MobileRelayCredentialBundle
): Promise<void> {
  requireNativeSecretStore()
  const validated = MobileRelayCredentialBundleSchema.parse(bundle)
  markHostCredentialWrite(validated.hostId)
  await writePairingKeychainItem(credentialKey(validated.hostId), JSON.stringify(validated))
}

export async function deleteMobileRelayCredentialBundle(hostId: string): Promise<void> {
  if (Platform.OS === 'web') {
    return
  }
  await deletePairingKeychainItem(credentialKey(hostId))
}

function requireNativeSecretStore(): void {
  if (Platform.OS === 'web') {
    throw new Error('Orca Relay credentials require a native secret store')
  }
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Gate relay credential access on `Platform.OS !== 'web'` at the call site, or exclude this module from web builds.
  2. On web, use a web-specific credential strategy (or none) rather than the native bundle functions.
  3. In tests, mock `Platform.OS` to `'ios'`/`'android'` before exercising these functions.

Example fix

// before
import { readMobileRelayCredentialBundle } from './mobile-relay-credential-bundle'
const bundle = await readMobileRelayCredentialBundle(hostId) // throws on web

// after
import { Platform } from 'react-native'
const bundle = Platform.OS === 'web' ? null : await readMobileRelayCredentialBundle(hostId)
Defensive patterns

Strategy: type-guard

Validate before calling

import { Platform } from 'react-native'
if (Platform.OS === 'web') { /* use web credential strategy or skip */ return }

Type guard

function hasNativeSecretStore(): boolean { return Platform.OS !== 'web' }

Prevention

When it happens

Trigger: Calling `readMobileRelayCredentialBundle` or `writeMobileRelayCredentialBundle` while running on the web platform; importing the mobile relay module in a web test/storybook without a platform guard.

Common situations: A web build of the React Native app that links the mobile transport module; Storybook or Jest running under `Platform.OS = 'web'`; a shared import path that pulls credential code into the web bundle.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/7651f3c990e87443. Report an issue: GitHub.