Reference / @getenginex/sdk / SessionApi
SessionApi
Read access to the current session.
Methods
get()
get():
Session
Current session: a frozen object, with the same reference between calls while the tokens do not change. Safe to use with useSyncExternalStore (React) without a re-render loop.
Returns
Example
ts
if (enginex.session.get().status === 'authenticated') showWallet()subscribe()
subscribe(
listener): () =>void
Subscribes to session changes; returns the function to cancel.
Parameters
listener
(session) => void
Returns
() => void
Example
ts
const off = enginex.session.subscribe((s) => console.log(s.status))