Sessions
Review the active sessions for the signed-in user, revoke a single device, or sign out everywhere. Pollar renders the list and actions inside a modal.
Drop-in button that opens a prebuilt modal — the device list, revoke and sign-out-everywhere actions are all rendered for you.
openSessionsModal() takes no arguments — it lists the current user's sessions and handles revocation.
Hook & values used
All of these come from the usePollar() hook — the react layer built on top of getClient().
usePollar()hookparams: No arguments. Call it at the top level of a component — it reads React context, so it must run during render.
returns: PollarContextValue — the whole SDK surface: reactive state values, modal openers, and getClient() to drop down to core.
openSessionsModal()syncparams: No arguments — it lists the current user's sessions and handles revocation.
returns: void — opens the prebuilt modal; there is nothing to await.
sessionsreactive valueparams: Not a function — a value of type SessionsState read from usePollar().
returns: Re-renders as the list loads or a device is revoked. Mirrors getClient().getSessionsState().
import { usePollar } from '@pollar/react'; export function SessionsButton() { const { openSessionsModal, isAuthenticated } = usePollar(); // openSessionsModal renders the list + revoke / sign-out-everywhere // actions on top of client.listSessions / revokeSession. return ( <button onClick={openSessionsModal} disabled={!isAuthenticated} > Manage sessions </button> ); }