Skip to Content
API referenceSIWX ReactSrcComponentsuseSiwxSession()

API Reference — @tuwaio/siwx (CAIP-122 Authentication Layer)


useSiwxSession()

useSiwxSession(): object

Defined in: packages/siwx-react/src/hooks.ts:186 

A selector hook that returns the current SIWX session state. Provides the current status, active session, and any error.

Returns

object

The current session state from the Zustand store.

error

error: string | null

isAuthenticated

isAuthenticated: boolean

session

session: SiwxClientSession | null

status

status: SiwxStatus

Example

const { status, session, error } = useSiwxSession(); if (status === 'authenticated') { console.log('Signed in as:', session?.address); }
Last updated on