How It Works
- SDK detects no session key → shows the setup UI
- User reviews the daily limit → approves in your wallet
- SDK generates a keypair on-device, stores private key in Keychain
- SDK registers the public key with the TapRails backend
- Future payments are signed by the session key — no user interaction
Automatic Setup with TapRailsThemeProvider
The simplest setup — wrap your app withTapRailsThemeProvider and configure sessionKey in initialize(). The SDK handles detection and UI automatically.
App.tsx
TapRailsThemeProvider checks for a valid session key on mount. If none is found (or the key has expired and autoRenew: true), it automatically shows the SessionKeySetupFlow screen.
Manual Setup with SessionKeySetupFlow
For more control over when the setup flow is shown:WalletScreen.tsx
useSessionKey Hook
For programmatic session key management:Checking key status
Revoking a session key
Integrating with Popular Wallet Providers
Security Notes
- Session key private keys never leave the device — they’re stored in the OS Keychain
- The daily limit is enforced on-chain by the ERC-20 approval
- Keys are automatically invalidated on the backend if revoked
- Each device generates its own keypair — a key from one device cannot be used on another

