> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# useChipiSession

> Unified session key management for gasless UX - create, register, execute, and revoke sessions with a single hook.

See the full documentation in the [React SDK](/sdk/react/hooks/use-chipi-session). This hook is available identically in `@chipi-stack/chipi-react`, `@chipi-stack/nextjs`, and `@chipi-stack/chipi-expo`.

<Warning>Session keys only work with **CHIPI wallets**.</Warning>

```typescript theme={null}
import { useChipiSession } from "@chipi-stack/chipi-react";
// or: import { useChipiSession } from "@chipi-stack/nextjs";
// or: import { useChipiSession } from "@chipi-stack/chipi-expo";

const {
  session,
  sessionState,
  hasActiveSession,
  remainingCalls,
  createSession,
  registerSession,
  executeWithSession,
  revokeSession,
  isCreating,
  isRegistering,
  isExecuting,
} = useChipiSession({
  wallet,
  encryptKey: pin,
  getBearerToken: getToken,
  storedSession,
  onSessionCreated: (session) => {
    localStorage.setItem("chipi-session", JSON.stringify(session));
  },
});
```
