Overview
useChipiSession provides a unified API for managing session keys, enabling gasless transactions without requiring the owner’s signature for each operation.
This hook combines all session-related operations:
- Session creation (local keypair generation)
- Session registration (on-chain)
- Transaction execution (using session key)
- Session revocation (on-chain)
- Status checking (remaining calls, expiration)
Prerequisites
Before usinguseChipiSession, you need:
- A wallet that supports sessions: CHIPI, or SHHH with a STARK / ED25519 signer (check
supportsSession,wallet.supportsSessionKeysorwalletSupportsSessions(wallet)) - The user’s encryption key: a PIN (
encryptKey) or a function that resolves it on demand, such as a passkey (getEncryptKey, 14.14.0+) - An authentication token (from Clerk, Firebase, etc.)
Session Lifecycle
Quick Start
Passkey wallets and server-held sessions (14.14.0+)
For an agent that runs on your server, create the session key there and register it from the app with the user’s biometrics. The session and its spending caps go in one owner-signed transaction, so the user sees one prompt:allowedEntrypoints are converted to selectors. The whole flow, server side included, is in Agent with a session key and a passkey.
Configuration Options
Return Values
Session Data
Actions
Loading States
Persisting Sessions with SecureStore
In Expo, useexpo-secure-store to safely persist session data:
Using with Biometrics
Combine withuseBiometrics hook for secure PIN-less UX:
Executing Transactions
TheexecuteWithSession method accepts an array of Starknet calls:
