React Native
decane-connect-kit-expo brings the same wallets to iOS and Android. It is headless — functions only, no components — so the wallet UI is entirely yours. Everything below is in addition to the web SDK, not a replacement for it: a user who signs in on your website and in your app gets the same wallet, provided both use the same appId.
Install
npx expo install decane-connect-kit-expo \
expo-secure-store expo-crypto expo-local-authentication expo-web-browser
// optional — unlocks the passkey tier
npx expo install react-native-passkeys
// optional — native Google Sign-In
npx expo install @react-native-google-signin/google-signincrypto.getRandomValues and Buffer are polyfilled by the SDK on import, so you do not need react-native-get-random-values.
Expo Go will not work. These are native modules, so the app must be a development build. Expo Go has no binary for them and rejects the project before any JavaScript runs — which presents as the app opening and closing instantly with nothing in the Metro logs. Run npx expo prebuild then npx expo run:android (or run:ios).
Configuration
import { createDecaneConnect } from "decane-connect-kit-expo";
const decane = await createDecaneConnect({
appId: "proj_…",
apiKey: "dck_live_…",
chains: ["evm:8453", "solana:mainnet"],
authMethods: ["email", "google"],
redirectUri: "yourapp://auth", // Google and KingsChat return here
promptPin: async () => showPinSheet(),
rpId: "app.example.com", // optional — enables the passkey tier
});The native config is a strict superset of the web one — five extra keys, nothing web-only. They all exist for the same reason: the browser infers them from windowor from having WebAssembly, and React Native has neither.
| Key | Why it is native-only |
|---|---|
verifyAttestation | No WebAssembly, so the DCAP quote verifier cannot run on device |
insecureSkipAttestation | Development escape hatch; web can always verify locally |
origin | Android’s WebAuthn origin is android:apk-key-hash:…, not a URL |
redirectUri | No window.location.origin to fall back on |
unlockPreference | Native has three unlock tiers; web has two |
Two shared keys also behave differently. rpId defaults to the hostname on web but has no default here — leaving it unset silently drops you to the secure-enclave tier. And persistSession uses sessionStorage on web, which dies with the tab; on native a session survives an app restart until its recorded expiry, because backgrounding an app is not a sign-out.
Unlock tiers
The device’s share of the key is encrypted at rest. Which key protects it depends on what the device can actually do — the SDK probes each tier in order and uses the first that genuinely works. You do not choose it; the device does.
| Tier | Key source | Passkey sign-in | New device |
|---|---|---|---|
passkey | WebAuthn PRF output | yes | passkey sync |
secure-enclave | random key in Keychain / Keystore, behind biometrics | no | recovery file |
pin | PBKDF2 over a user PIN | no | recovery file |
const caps = await decane.getCapabilities();
// { passkeys, passkeyPrf, secureEnclave, activeUnlockMethod }
// narrow or reorder the tiers
unlockPreference: ["secure-enclave", "pin"]The passkey probe is a real ceremony, not a feature flag: a device that reports passkey support but returns no PRF output falls through to the next tier rather than ending up with a wallet nothing can unlock.
Expect two biometric prompts at signup on the passkey tier — one to create the credential, one to evaluate the PRF salt. That is how the WebAuthn PRF extension behaves on iOS and Android: create() reports only that PRF is available. It does not repeat on later unlocks.
The passkey tier also needs an associated domain: webcredentials:<rpId> plus an apple-app-site-association file on iOS, and assetlinks.json on Android. On Android you must additionally pass origin, because Android reports an APK key hash rather than a URL.
Signing in
// Email — nothing to register
await decane.connectWithEmail(email);
await decane.verifyEmailCode(email, code);
// Google — nothing to register with Google at all
await decane.connectWithGoogle();
// KingsChat
await decane.connectWithKingsChat();
// Your own identity provider
await decane.connectWithToken(idToken);
// Returning user who still has their passkey on this device
if (await decane.canSignInWithPasskey()) await decane.signInWithPasskey();Use connectWithGoogleToken, not connectWithToken, for Google. The latter goes through the generic external-provider path, which namespaces the identity by provider and would hand the same person a different wallet than your website does.
connectWithGoogle() opens an in-app auth sheet — ASWebAuthenticationSession on iOS, a Chrome Custom Tab on Android — and returns to redirectUri when the user is done. Your app is never backgrounded.
Nothing to register in Google Cloud. The OAuth client is Decane’s and the redirect goes to Decane’s backend, which then hops to your scheme — so Google never sees your package name, bundle ID or signing fingerprint. That means no per-build SHA-1 registration, and nobody blocking your release.
A native account sheet is available via connectWithGoogleToken() if you prefer it, but it is opt-in: Google must then know your exact binary, which means registering a package name and a SHA-1 for every build type (debug, release, and Play App Signing produce three different fingerprints).
Using the wallet
decane.getAddresses(); // { evm, solana, tron } | null
decane.isUnlocked();
decane.needsReconnect(); // known identity, dead session → show sign-in
decane.getAccessToken(); // Decane JWT, for your own backend
await decane.signMessage({ chain: "evm:8453", message: "gm" });
await decane.sendTransaction({ chain: "evm:8453", to, value });
await decane.signTypedData({ chain: "evm:8453", domain, types, message });
await decane.signSolanaTransaction(serializedTx); // you broadcast
await decane.getBalances();
decane.on("wallet-creating", () => showProgress());wallet-creating is worth a progress state: it covers key generation, the Shamir split, unlock-tier setup and the first enclave session, and takes several seconds.
Getting back in
By default a user who reinstalls your app, or opens it on a new phone, gets their wallet back from signing in alone — nothing to write down, nothing to keep.
What this costs you. Enrolling stores a second Shamir share sealed to the enclave, so the enclave can rebuild a wallet by itself. It is encrypted with a key derived inside the TEE, so your backend and its database still cannot — but a malicious enclave image, or anyone able to mint JWTs, could. That is the deliberate trade for a wallet a person can always get back into.
Wire up the recovery-file callbacks regardless — they are the fallback when server-assisted recovery is off or unavailable: onRecoveryShareOffer, onRecoveryFileReady, promptForRecoveryFile and onRecoveryRotated. Every recovery and rotation invalidates the previous file, so the last of those must capture a password for the replacement.
Attestation
React Native has no WebAssembly, so the Intel DCAP quote verifier the web SDK runs cannot execute on device. Without verifyAttestation, the SDK can only check that the enclave reports the measurement you pinned — which the enclave asserts about itself. That is a consistency check, not a proof. Supply the hook in production and verify the quote server-side.
Performance
PBKDF2 runs in pure JavaScript here — there is no native implementation to call — so 600,000 iterations costs seconds, not milliseconds. It is paid only on PIN unlock and on recovery-file encrypt/decrypt; never on the passkey or biometric path, and never per signature. Show a spinner on those two flows.