PollarPollarDemo

Products

WalletTransactionsSessionsDistribution

Integrations

KYCSoonRampNewSwapNew

Wallet Adapters

Stellar Wallets KitPrivyNewAcceslySoon

Built with Pollar

Trustless WorkNiriumNewLumenWipeNew
WalletTransactionsSessionsDistributionKYCSoonRampNewSwapNewStellar Wallets KitPrivyNewAcceslySoonTrustless WorkNiriumNewLumenWipeNew

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()hook

    params: 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()sync

    params: No arguments — it lists the current user's sessions and handles revocation.

    returns: void — opens the prebuilt modal; there is nothing to await.

  • sessionsreactive value

    params: 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().

@pollar/react— hooks & components
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>
  );
}