Skip to content

ISessionManager

Defined in: session/manager.ts:46

Interface for session managers.

Session managers track and manage external resources (browser pages, API connections, etc.) that need to be shared across multiple gadgets and properly cleaned up.

TSession = unknown

Type of session object (e.g., Page, APIClient)

TConfig = unknown

Configuration type for creating sessions

closeAll(): Promise<void>

Defined in: session/manager.ts:82

Close all sessions.

Promise<void>


closeSession(id): Promise<void>

Defined in: session/manager.ts:77

Close and remove a session.

string

Session ID to close

Promise<void>


createSession(config?): Promise<string>

Defined in: session/manager.ts:53

Create a new session.

TConfig

Optional configuration for the session

Promise<string>

Promise resolving to the session ID


getSession(id): TSession | undefined

Defined in: session/manager.ts:61

Get a session by ID.

string

Session ID

TSession | undefined

Session object or undefined if not found


hasSession(id): boolean

Defined in: session/manager.ts:97

Check if a session exists.

string

Session ID

boolean

True if session exists


listSessions(): string[]

Defined in: session/manager.ts:89

List all active session IDs.

string[]

Array of session IDs


requireSession(id): TSession

Defined in: session/manager.ts:70

Get a session by ID, throwing if not found.

string

Session ID

TSession

Session object

Error if session not found