@suluk/better-auth - v0.2.0
    Preparing search index...

    Interface SessionLike

    A minimal view of a Better Auth session (duck-typed; works with the real Session shape).

    interface SessionLike {
        user?: { role?: string | string[]; scopes?: string[] } | null;
        apiKey?:
            | { scopes?: string[]; permissions?: Record<string, string[]> }
            | null;
        scopes?: string[];
        twoFactorVerified?: boolean;
        organizations?: { id: string; role?: string; scopes?: string[] }[];
    }
    Index

    Properties

    user?: { role?: string | string[]; scopes?: string[] } | null
    apiKey?: { scopes?: string[]; permissions?: Record<string, string[]> } | null

    apiKey plugin: a key carries its own permissions/scopes.

    scopes?: string[]
    twoFactorVerified?: boolean

    twoFactor plugin: the session has cleared its second factor ⇒ the mfa:verified scope (Phase 1).

    organizations?: { id: string; role?: string; scopes?: string[] }[]

    organization plugin: memberships → org:<id>:<scope> scopes (Phase 1, tenancy via scope-encoding).