@truly-you/react-native-sdk
v0.2.2
Published
Truly You React Native SDK - zero-config passkey authentication
Maintainers
Readme
@truly-you/react-native-sdk
React Native SDK for Truly You authentication with passkeys and NFC passport reading.
Installation
npm install @truly-you/react-native-sdkThe SDK will automatically configure your project for NFC passport reading during installation.
Peer Dependencies
npm install @react-native-async-storage/async-storage react-native-config react-native-passkeyiOS Setup (Automatic)
The SDK automatically:
- ✅ Configures
Info.plistwith NFC permissions - ✅ Updates
Podfilewith iOS 15.0 deployment target - ✅ Adds NFC entitlements
- ✅ Installs
NFCPassportReadervia CocoaPods
One manual step required:
- Open your project in Xcode
- Go to: Target → Signing & Capabilities
- Click "+ Capability" and add "Near Field Communication Tag Reading"
- Run:
cd ios && pod install - Rebuild your app
Android Setup (Automatic)
Android is fully configured automatically:
- ✅ NFC permissions are merged via autolinking
- ✅ Dependencies (JMRTD, Scuba) are included
- ✅ No manual steps required
If you need to manually run setup:
npx @truly-you/react-native-sdk scripts/setup.jsUsage
import { TrulyYouReactNativeSDK } from '@truly-you/react-native-sdk'
// Initialize SDK
const sdk = new TrulyYouReactNativeSDK({
apiUrl: 'https://api.dev.ng.truly.you',
authAppId: 'your-auth-app-id',
keyId: 'user-key-id'
})
// Start enrollment
await sdk.startEnrollment()
// Fetch with signature
const result = await sdk.fetchWithSignature('https://your-api.com/endpoint', {
method: 'POST',
body: JSON.stringify({ data: 'example' })
})Configuration
The SDK automatically fetches configuration from the backend, including:
- SDK Frontend URL
- Deep link scheme for enrollment callbacks
You only need to provide:
apiUrl: Your SDK backend URLauthAppId: Your authentication app IDkeyId: The passkey ID stored on the device
License
MIT
