# Class BaseSessionService`Abstract`

Base class for session services.

The service provides a set of methods for managing sessions and events.

#### Hierarchy (View Summary)

- BaseSessionService
  - DatabaseSessionService
  - InMemorySessionService

- Defined in sessions/base_session_service.ts:100

## Constructors

### constructor

- new BaseSessionService(): BaseSessionService

  #### Returns BaseSessionService

## Methods

### appendEvent

- appendEvent(request: AppendEventRequest): Promise<Event>

  Appends an event to a session.

  #### Parameters

  - request: AppendEventRequest

    The request to append an event.

  #### Returns Promise<Event>

  A promise that resolves to the event that was appended.

  - Defined in sessions/base_session_service.ts:163

### `Abstract` createSession

- createSession(request: CreateSessionRequest): Promise<Session>

  Creates a new session.

  #### Parameters

  - request: CreateSessionRequest

    The request to create a session.

  #### Returns Promise<Session>

  A promise that resolves to the newly created session instance.

  - Defined in sessions/base_session_service.ts:107

### `Abstract` deleteSession

- deleteSession(request: DeleteSessionRequest): Promise<void>

  Deletes a session.

  #### Parameters

  - request: DeleteSessionRequest

    The request to delete a session.

  #### Returns Promise<void>

  A promise that resolves when the session is deleted.

  - Defined in sessions/base_session_service.ts:155

### getOrCreateSession

- getOrCreateSession(request: CreateSessionRequest): Promise<Session>

  Gets a session or creates one if it doesn't exist.

  #### Parameters

  - request: CreateSessionRequest

    The request to get or create a session.

  #### Returns Promise<Session>

  A promise that resolves to the session instance.

  - Defined in sessions/base_session_service.ts:124

### `Abstract` getSession

- getSession(request: GetSessionRequest): Promise<Session | undefined>

  Gets a session.

  #### Parameters

  - request: GetSessionRequest

    The request to get a session.

  #### Returns Promise<Session | undefined>

  A promise that resolves to the session instance or undefined if not found.

  - Defined in sessions/base_session_service.ts:116

### `Abstract` listSessions

- listSessions(request: ListSessionsRequest): Promise<ListSessionsResponse>

  Lists sessions for a user.

  #### Parameters

  - request: ListSessionsRequest

    The request to list sessions.

  #### Returns Promise<ListSessionsResponse>

  A promise that resolves to a list of sessions for the user.

  - Defined in sessions/base_session_service.ts:145