pnpm add @securelink/react-native react-native-keychainProduction requirements
- Keychain / Keystore — install
react-native-keychain(or pass Expo SecureStore). Memory fallback is off unlessallowInsecureMemoryStorage: true(demos only). - Attestation — pass
getAttestationTokenfor App Attest / Play Integrity. Stub proofs are off unlessallowInsecureDevAttestation: true(demos only). - Server must set
tokenHashSecret, real attestation verifiers, and not useallowInsecureDevMode.
Anonymous
import {
createReactNativeSecureLink,
createKeychainStorage,
} from "@securelink/react-native";
import * as Keychain from "react-native-keychain";
const client = createReactNativeSecureLink({
baseUrl: "https://api.example.com",
authMode: "anonymous",
nativePlatform: "ios",
secureStorage: createKeychainStorage(Keychain), // or rely on auto-detect
getAttestationToken: (challenge) => nativeAppAttest(challenge),
});Custom auth
const client = createReactNativeSecureLink({
baseUrl: "https://api.example.com",
authMode: "customAuth",
nativePlatform: "android",
getAttestationToken: (challenge) => playIntegrity(challenge),
authorization: {
async getAuthorization() {
return { authorization: `Bearer ${userToken}`, scheme: "custom" };
},
},
});customAuth skips anonymous identity; attestation stays on by default.