Developers

Journey manager

API reference

@nlxai/journey-manager

Interfaces

References

default

Renames and re-exports run

Type Aliases

HandlerArg

Ƭ HandlerArg: SimpleHandlerArg & { triggeredSteps: TriggeredStep[] }

Used for some more advanced callbacks

Defined in

journey-manager/src/configuration.ts:50


Method

Ƭ Method: "AltText" | "DisplayValue" | "LabelText" | "PlaceholderText" | "Role" | "TestId" | "Text" | "Title" | "QuerySelector"

Matching method

Defined in

journey-manager/src/queries.ts:10


Triggers

Ƭ Triggers: Record<StepId, Trigger>

A record of triggers

Defined in

journey-manager/src/trigger.ts:32


StepId

Ƭ StepId: string

Step ID

Defined in

journey-manager/src/trigger.ts:61

Functions

run

run(props): Promise<RunOutput>

Run the multimodal journey

Parameters

NameTypeDescription
propsRunPropsThe run configuration object

Returns

Promise<RunOutput>

an promise of an object containing a teardown function and the multimodal client.

Defined in

journey-manager/src/index.ts:83

Interfaces

Interface: ButtonConfig

Button configuration

Properties

label

label: string

Button label

Defined in

journey-manager/src/configuration.ts:62


confirmation

Optional confirmation: string

Button confirmation: if present, the button click handler only triggers after the confirmation button is hit

Defined in

journey-manager/src/configuration.ts:66


iconUrl

Optional iconUrl: string

Icon URL

Defined in

journey-manager/src/configuration.ts:70


onClick

onClick: (config: HandlerArg) => void

Click handler

Type declaration

▸ (config): void

Parameters
NameType
configHandlerArg
Returns

void

Defined in

journey-manager/src/configuration.ts:74

Interface: EncodedQuery

Encoded query

Properties

name

name: Method

Query name

Defined in

journey-manager/src/queries.ts:60


target

target: string | SerializedRegex

Query target

Defined in

journey-manager/src/queries.ts:64


options

options: null | Record<string, boolean | SerializedRegex>

Query options

Defined in

journey-manager/src/queries.ts:68


parent

parent: null | EncodedQuery

Query parent

Defined in

journey-manager/src/queries.ts:72

Interface: RunOutput

Created by run.

Properties

teardown

teardown: () => void

Stop running the journey, removing all event listeners

Type declaration

▸ (): void

Returns

void

Defined in

journey-manager/src/index.ts:71


client

client: Client

The regular multimodal SDK client

Defined in

journey-manager/src/index.ts:75

Interface: RunProps

Configuration for the run method

Properties

config

config: Config

The regular multimodal configuration

Defined in

journey-manager/src/index.ts:44


ui

Optional ui: UiConfig

UI configuration

Defined in

journey-manager/src/index.ts:48


triggers

Optional triggers: Triggers

The triggers dictionary, downloaded from the Dialog Studio desktop app. If triggers are not provided, they will be fetched from the CDN.

Defined in

journey-manager/src/index.ts:53


onDigression

Optional onDigression: (client: Client) => void

Digression detection callback

Type declaration

▸ (client): void

Parameters
NameType
clientClient
Returns

void

Defined in

journey-manager/src/index.ts:57


onStep

Optional onStep: (stepId: string) => void

Runs when a step is triggered, used primarily for debugging

Type declaration

▸ (stepId): void

Parameters
NameType
stepIdstring
Returns

void

Defined in

journey-manager/src/index.ts:61

Interface: SerializedRegex

Serialized regex

Properties

regexp

regexp: string

Regex body

Defined in

journey-manager/src/queries.ts:46


flags

flags: string

Regex flags

Defined in

journey-manager/src/queries.ts:50

Interface: SimpleHandlerArg

The argument for callbacks

Properties

sendStep

sendStep: (stepId: string, context?: Context) => Promise<void>

A function to send steps to NLX.

Type declaration

▸ (stepId, context?): Promise<void>

Parameters
NameType
stepIdstring
context?Context
Returns

Promise<void>

Defined in

journey-manager/src/configuration.ts:46

Interface: Theme

Visual theme for the UI

Properties

colors

Optional colors: ThemeColors

UI colors

Defined in

journey-manager/src/configuration.ts:28


fontFamily

Optional fontFamily: string

Font family

Defined in

journey-manager/src/configuration.ts:32

Interface: ThemeColors

Theme colors

Properties

primary

Optional primary: string

Primary color

Defined in

journey-manager/src/configuration.ts:10


primaryHover

Optional primaryHover: string

Primary color on hover

Defined in

journey-manager/src/configuration.ts:14


highlight

Optional highlight: string

Color for trigger highlights

Defined in

journey-manager/src/configuration.ts:18

Interface: Trigger

A single trigger

Properties

event

event: "click" | "pageLoad" | "appear" | "enterViewport"

Event

Defined in

journey-manager/src/trigger.ts:14


query

Optional query: EncodedQuery

A query identifying the element

Defined in

journey-manager/src/trigger.ts:18


once

Optional once: boolean

A flag specifying whether the trigger should only fire a single time

Defined in

journey-manager/src/trigger.ts:22


urlCondition

Optional urlCondition: UrlCondition

URL condition

Defined in

journey-manager/src/trigger.ts:26

Interface: TriggeredStep

Represents a load step that has already been triggered.

Properties

stepId

stepId: string

step id

Defined in

journey-manager/src/configuration.ts:38


url

url: string

the URL of the page it triggered on

Defined in

journey-manager/src/configuration.ts:40

Interface: UiConfig

Full UI configuration

Properties

title

title: string

Drawer title

Defined in

journey-manager/src/configuration.ts:84


subtitle

subtitle: string

Drawer subtitle

Defined in

journey-manager/src/configuration.ts:88


highlights

Optional highlights: boolean

Render highlights

Defined in

journey-manager/src/configuration.ts:92


iconUrl

Optional iconUrl: string

URL for the button icon

Defined in

journey-manager/src/configuration.ts:96


theme

Optional theme: Theme

UI theme

Defined in

journey-manager/src/configuration.ts:100


onEscalation

Optional onEscalation: (config: SimpleHandlerArg) => void

Escalation handler

Type declaration

▸ (config): void

Parameters
NameType
configSimpleHandlerArg
Returns

void

Defined in

journey-manager/src/configuration.ts:104


escalationButtonLabel

Optional escalationButtonLabel: string

Escalation button label

Defined in

journey-manager/src/configuration.ts:108


escalationConfirmation

Optional escalationConfirmation: string

Escalation confirmation

Defined in

journey-manager/src/configuration.ts:112


onEnd

Optional onEnd: (config: SimpleHandlerArg) => void

End handler

Type declaration

▸ (config): void

Parameters
NameType
configSimpleHandlerArg
Returns

void

Defined in

journey-manager/src/configuration.ts:116


endButtonLabel

Optional endButtonLabel: string

End button label

Defined in

journey-manager/src/configuration.ts:120


endConfirmation

Optional endConfirmation: string

End confirmation

Defined in

journey-manager/src/configuration.ts:124


onPreviousStep

Optional onPreviousStep: (config: HandlerArg) => void

On previous step

Type declaration

▸ (config): void

Parameters
NameType
configHandlerArg
Returns

void

Defined in

journey-manager/src/configuration.ts:128


previousStepButtonLabel

Optional previousStepButtonLabel: string

Previous step button label

Defined in

journey-manager/src/configuration.ts:132


buttons

Optional buttons: ButtonConfig[]

Custom buttons

Defined in

journey-manager/src/configuration.ts:136


nudgeContent

Optional nudgeContent: string

If this is set, the journey manager will show a call-to-action tooltip to invite the user to interact with the overlay pin. it will be shown only if the user never interacts with the overlay pin, after tooltipShowAfterMs milliseconds.

Defined in

journey-manager/src/configuration.ts:141


nudgeShowAfterMs

Optional nudgeShowAfterMs: number

Show nudge tooltip after this many milliseconds

Defined in

journey-manager/src/configuration.ts:145


nudgeHideAfterMs

Optional nudgeHideAfterMs: number

Hide nudge tooltip after it's been shown for this many milliseconds

Defined in

journey-manager/src/configuration.ts:149

Interface: UrlCondition

URL match condition

Properties

operator

operator: "contains" | "matches_regex" | "smart_match"

Condition operator

Defined in

journey-manager/src/UrlCondition.ts:8


value

value: string

Condition value

Defined in

journey-manager/src/UrlCondition.ts:12