Skip to main content

ISessionHandler

Overview

This interface defines the methods required to manage a commerce session for the High Velocity front-end app in a vendor-agnostic way.

Functions

clearSession

Clear the current session.

Parameters

None

Return Value

type: Promise<void>

A promise that resolves when the session is cleared.

getSession

Retrieve the current session or create a new session, depending on the given options.

Parameters

options (optional)

type: GetSessionOptions

The options for retrieving the session.

Return Value

type: Promise<CommerceSession | undefined>

A promise that resolves to the current session or undefined if no session is found or created.

updateSession

Update the current session with the given session data.

Parameters

session

type: CommerceSession

The session data to update.

Return Value

type: Promise<void>

A promise that resolves when the session is updated.

CommerceSession

This type represents a generic commerce session state.

Attributes

id

type: string


The unique identifier for the session.

cartID (optional)

type: string


The unique identifier for the cart associated with the session.

locale (optional)

type: string


The locale associated with the session.

[key: string]: any

type: any


Additional provider-specific properties that may exist for the session.