Requirements
- React 18+ or Next.js 13+
- Node.js 18+
- A Cavos App ID from the Dashboard
Installation
- npm
- yarn
- pnpm
Configuration
CavosProvider
Wrap your application withCavosProvider at the root level:
Configuration Options
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
appId | string | Yes | - | Your Cavos App ID |
network | ’sepolia’ | ‘mainnet’ | No | ’sepolia’ | Target Starknet network |
paymasterApiKey | string | No | Cavos shared key | Custom AVNU Paymaster API key |
starknetRpcUrl | string | No | Alchemy RPC | Custom Starknet RPC URL |
enableLogging | boolean | No | false | Enable SDK debug logging |
session | SessionConfig | No | - | Session duration and default policy |
slot | SlotConfig | No | - | Cartridge Slot (Katana) configuration — enables executeOnSlot() |
Slot (Cartridge Katana) Configuration
If your app runs on a Cartridge Slot (a private, fee-free Katana chain forked from mainnet) or a local Katana node, add theslot key to your config. This unlocks executeOnSlot() — gasless transactions on the Slot chain with no paymaster needed.
[!WARNING] Important: Katana sequencers often reportSN_MAINvia their RPC, but use a custom internal chain ID inside the Cairo VM. Because the Cavos session registration signature depends on this internal chain ID, you must manually set thechainIdin your config to match the internal ID of your Katana genesis (e.g.,WP_CAVOS/0x57505f4341564f53). If you do not provide the correct internalchainId, you will encounter an “Invalid session key signature” error.
| Property | Type | Required | Description |
|---|---|---|---|
rpcUrl | string | Yes | RPC URL of your Cartridge Katana Slot instance |
chainId | string | Yes | Chain ID for the Slot chain. You must provide the exact internal VM chain ID to avoid signature mismatches. |
[!NOTE] No relayer configuration is needed. The SDK uses a built-in Cavos relayer for the initial JWT session registration on Slot. Subsequent transactions use the session key directly.
Next.js App Router
For Next.js 13+ with App Router, mark the provider as a client component:Exports
The package exports:| Export | Description |
|---|---|
CavosProvider | React context provider |
useCavos | Main hook for SDK access |
CavosSDK | Direct SDK class (advanced) |
JwtExpiredError | Error class for expired JWTs |
OAuthWalletManager | Identity & JWT handling (advanced) |
OAuthTransactionManager | Transaction execution (advanced) |
SessionManager | Session key lifecycle (advanced) |
PaymasterIntegration | Paymaster wrapper (advanced) |
WalletStatus | TypeScript type for wallet state |
SessionKeyPolicy | TypeScript type for session policies |

