Skip to content

useSessions

Hook for getting sessions

Import

import { useSessions } from '@zerodev/waas'

Usage

import { useSessions } from '@zerodev/waas';
 
function App() {
  const sessions = useSessions();
}

Parameters

No parameter needed.

Return Types

import { type UseSessionsReturnType } from '@zerodev/waas'

sessions

[sessionId: string]: SessionInfoType | null

The session used in the smart account.

  • SessionInfoType
    • sessionKey
      0x${string} The private key of the session.
    • sessionId
      0x${string} The id of the session.
    • smartAccount
      0x${string} The address of smart account.
    • enableSignature
      0x${string} The signature to enable session.
    • policies
      Policy[] The policies of session.
    • permissions
      Permission<Abi>[] The permissions of the session.