Skip to main content
const ctx = useSunbreak();

Shape

{
  get<T>(path: string, opts?: RequestInit): Promise<T | undefined>;
  post<T>(path: string, body?: unknown, opts?: RequestInit): Promise<T | undefined>;
  session(): Promise<SessionResp | undefined>;
  refresh(): Promise<boolean>;
  authenticated: boolean;
  loading: boolean;
  error: string | null;
  allowed: boolean | null;
  sessionExpiry: number | null;
  sessionData: SessionResp | null;
}
loading reflects the number of in‑flight requests.