Skip to main content

Context

Stentor API Reference


Stentor API Reference / stentor-models/src / Context

Interface: Context\<S>

Defined in: packages/stentor-models/src/Context.ts:48

Context object that is passed around while formulating the response.

It contains contextual information relevant to the user.

Type Parameters​

S​

S extends Storage = Storage

Properties​

device​

device: Device

Defined in: packages/stentor-models/src/Context.ts:54

Information about the current device the user is on within the channel.

Deprecated​

  • Will be removed in next major release. You can find the same information on the request. The information will continue to be in both places until removal.

storage​

storage: S

Defined in: packages/stentor-models/src/Context.ts:58

Long term storage for the user.


pii?​

optional pii: Pii

Defined in: packages/stentor-models/src/Context.ts:62

The PII record


response​

response: AbstractResponseBuilder

Defined in: packages/stentor-models/src/Context.ts:66

The response builder.


requestUserData?​

optional requestUserData: UserData

Defined in: packages/stentor-models/src/Context.ts:70

A method that serves user profile data (email, location, phone number, etc)


session?​

optional session: SessionStore

Defined in: packages/stentor-models/src/Context.ts:74

Session data. Gets deleted when session (id) changes)


services​

services: ContextServices

Defined in: packages/stentor-models/src/Context.ts:82

Services available for the handlers

Methods​

timeLeftInMillis()?​

optional timeLeftInMillis(): number

Defined in: packages/stentor-models/src/Context.ts:78

Milliseconds left from the execution (NOTE: infinity if not executing in a lambda)

Returns​

number