React Native SDK#
The Curity HAAPI React Native SDK is the sole user-facing surface for React Native apps. It exposes a TypeScript API that mirrors the structure of the native iOS and Android SDK Layers — HaapiManager for flow stepping, OAuthTokenManager for OAuth token lifecycle — wrapped together by HaapiAccessor and obtained from the initializeForHaapi / initializeForOAuth factories. Attestation, Dynamic Client Registration fallback, DPoP nonces, and error categorisation are handled internally across the native bridge to the iOS and Android SDKs.
This page is the platform-specific entry point: install instructions, the per-language reference, and pointers to the shared topic pages.
No UI Layer for React Native. Unlike iOS (UIKit) and Android (UIWidget), the React Native SDK does not ship prebuilt UI components. The host app renders each step using React components driven by the HaapiRepresentation discriminated union. See React Native Representations for how to switch on stepType.
Installation#
The React Native SDK ships as a single npm package, identityserver.haapi.reactnative.sdk. The native iOS and Android HAAPI SDKs are pulled in transitively — iOS via Swift Package Manager from the dist repository, Android via Maven through Gradle. No separate native declarations are required.
npm install identityserver.haapi.reactnative.sdk
The SDK targets React Native 0.85.3+ and Expo SDK 56+. See React Native Platform Notes for the full prerequisites (Node version, Xcode, Android SDK levels, CocoaPods setup).
Code Reference#
The auto-generated TypeScript reference, with the full public API surface, lives at:
https://curity.io/docs/haapi-react-native-sdk/latest/(published with the first public release)
For type signatures, parameter lists, and per-symbol documentation, follow the link above. The pages below cover configuration and usage patterns.
Topic Pages#
Foundational#
- Creating a HaapiAccessor —
initializeForHaapiandinitializeForOAuthfactories, accessor lifecycle, strict re-init rule - HAAPI Flow —
start → submitForm → followLinkstepping over Promises - OAuthTokenManager — fetch, refresh, revoke
- React Native Representations — switching on
stepTypeto render each step in your host app - Native Resolvers — the registry of pluggable Swift / Kotlin Resolvers behind every
Customoption in the JS configuration
Configuration#
- Token Binding —
IOSTokenBoundConfiguration/AndroidTokenBoundConfigurationrecords - DCR —
IOSDcrConfiguration/AndroidDcrConfigurationfor non-attestation devices - Risk Assessment —
useRiskAssessmentConfigurationflag - Client Authentication — per-platform factories:
noAuthentication,secretAuthentication,iOSJwtAsymmetricAuthentication,AndroidMtlsAuthentication, and others
Operational#
- Token Endpoint Response Listener — native-side listener hook for advanced integrations
- Error Handling —
isHaapiError(e)plus the stableHaapiErrorCodeenum - Logging —
getRNLogger,RNLogLevel, and custom sinks
Related: SDK Layer Overview · iOS SDK · Android SDK · React Native Reference