storage
Global storage instance that automatically selects the appropriate backend based on environment configuration.
Configuration
The storage backend is selected automatically:Storage Methods
generateSessionId(): string
Generate a unique session ID.
createSession(session: SessionData): Promise<void>
Create a new session. Throws if session already exists.
updateSession(identity: string, sessionId: string, data: Partial<SessionData>): Promise<void>
Update an existing session with partial data. Throws if session doesn’t exist.
getSession(identity: string, sessionId: string): Promise<SessionData | null>
Retrieve session data.
getIdentitySessionsData(identity: string): Promise<SessionData[]>
Get all session data for an identity.
getIdentityMcpSessions(identity: string): Promise<string[]>
Get all session IDs for an identity.
removeSession(identity: string, sessionId: string): Promise<void>
Delete a session.
getAllSessionIds(): Promise<string[]>
Get all session IDs across all users (admin operation).
clearAll(): Promise<void>
Clear all sessions (admin operation).
cleanupExpiredSessions(): Promise<void>
Clean up expired sessions (Redis only, no-op for others).
disconnect(): Promise<void>
Disconnect from storage backend.