@rosschiu/kiban-sdk
    Preparing search index...

    Interface SessionContext

    Client-persisted UX state: the active company switcher selection + preferences. NOT an authorization source — never trusted server-side, see this file's own header comment.

    interface SessionContext {
        clear(): void;
        getActiveCompanyId(): string | null;
        getPreference<T = unknown>(key: string): T | undefined;
        getPreferences(): Preferences;
        setActiveCompanyId(companyId: string | null): void;
        setPreference(key: string, value: unknown): void;
        subscribe(listener: () => void): () => void;
    }
    Index
    • Clears both activeCompanyId and preferences (call on logout).

      Returns void

    • Current active-company selection, or null if none set.

      Returns string | null

    • One stored preference by key.

      Type Parameters

      • T = unknown

      Parameters

      • key: string

      Returns T | undefined

    • Sets (or clears, with null) the active-company selection.

      Parameters

      • companyId: string | null

      Returns void

    • Sets one preference by key.

      Parameters

      • key: string
      • value: unknown

      Returns void

    • Subscribe to any change made through this instance. Returns an unsubscribe function.

      Parameters

      • listener: () => void

      Returns () => void