@valifysolutions/react-native-vidvauth
v4.0.4
Published
React Native bridge for the VIDV Auth SDK 4.x (Digital Identity Auth API v2, password + SSO authorization_code / user_assertion)
Readme
@valifysolutions/react-native-vidvauth
React Native bridge for the VIDV Auth SDK 4.0.2 — Valify Digital Identity Auth API v2, with password and SSO (federated) flows.
Version: 4.0.4 · Native Android: com.vidv:vidvauthsdk:4.0.2 · Native iOS: VIDVAuth ~> 4.0.4 (CocoaPods)
Features
- Turbo Module bridge (Android and iOS aligned to Auth SDK 4.0.2)
- Required
bundle_key+client_assertion - SSO:
user_assertionorauthorization_code+code_verifier - No builder
user_reference_id— returned by/auth/start - Optional post-auth (digital contract)
- Typed results + JS-side argument validation
- Example app aligned with the Android native demo
Docs
| Doc | Audience | |-----|----------| | docs/INTEGRATOR_GUIDE.md | App integrators (JS + Android) | | docs/IOS_MODULE_ALIGNMENT.md | iOS alignment record + known gaps | | docs/SSO.md | Federated grants | | docs/RESPONSE_HANDLING.md | Result envelopes | | docs/RUN_GUIDE.md | Running the example |
Installation
npm install @valifysolutions/[email protected]Android needs the Valify Maven repo and host activities — see the integrator guide. Request location before start() on Android.
Usage
Password
import { VIDVAuth } from '@valifysolutions/react-native-vidvauth';
const result = await new VIDVAuth().start({
base_url: 'https://di.valifystage.com',
bundle_key: 'YOUR_BUNDLE_KEY',
language: 'en',
client_assertion: assertionFromYourBackend,
security_type: 'password',
recovery_type: 'security_question',
});SSO — user assertion
await new VIDVAuth().start({
base_url: 'https://di.valifystage.com',
bundle_key: 'YOUR_BUNDLE_KEY',
language: 'en',
client_assertion: assertionFromYourBackend,
user_assertion: userJwtFromYourBackend,
});SSO — authorization code
await new VIDVAuth().start({
base_url: 'https://di.valifystage.com',
bundle_key: 'YOUR_BUNDLE_KEY',
language: 'en',
client_assertion: assertionFromYourBackend,
authorization_code: codeFromYourIdP,
code_verifier: pkceVerifier,
});Security: mint
client_assertion/user_assertionon your backend. Never ship the client secret.
Required builder / start inputs
| Field | Required |
|-------|----------|
| base_url | Yes |
| bundle_key | Yes |
| language | Yes (en | ar) |
| client_assertion | Yes |
| user_assertion or (authorization_code + code_verifier) | Optional SSO (exclusive) |
Run the local example
npm install
npm run example:start
npm run example:androidProject layout
crossplatform-react-vidvauth/
├── android/ # Turbo Module → VIDVAuthConfig (4.0.2)
├── ios/ # Swift bridge → VIDVAuthBuilder (4.0.4)
├── src/ # JS/TS API
├── example/ # Demo (parity with Android MainActivity)
└── docs/ # Integrator + iOS alignment guides