Skip to content
Dashboard
Theme
Theme

React Native SDK

Sign end users in through the hosted login from React Native, on top of the iOS and Android SDKs.

View Markdown

@ohauthcat/react-native runs the sign-in logic (PKCE, state, nonce, callback and ID-token checks, refresh, revocation) in TypeScript and uses the native iOS and Android SDKs for the system browser, secure storage, random bytes and passkeys. Tokens never go to AsyncStorage.

npm install @ohauthcat/react-native
cd ios && pod install
  • Create the client with new OhAuthCatClient({ loginOrigin, clientId, redirectUri }, nativePlatform(NativeModules.OhAuthCat, base64UrlDecode, fetch)).
  • Methods match the browser client: signIn, signOut, getAccessToken, refresh, getUser, switchOrganization, isSignedIn and passkeys(backend).
  • iOS: add the OhAuthCatReactNative pod. Android: the module autolinks; set manifestPlaceholders["ohauthcatRedirectScheme"].

The bridge validates every value from JavaScript; native rejections map to OhAuthCatError with the catalogue code.