Developers

Script manager

API reference

@nlxai/voice-plus-web

Interfaces

References

default

Renames and re-exports run

Type Aliases

HandlerArg

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

Used for some more advanced callbacks

Defined in

voice-plus-web/src/configuration.ts:50


Method

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

Matching method

Defined in

voice-plus-web/src/queries.ts:10


Triggers

Ƭ Triggers: Record<StepId, Trigger>

A record of triggers

Defined in

voice-plus-web/src/trigger.ts:36


StepId

Ƭ StepId: string

Step ID

Defined in

voice-plus-web/src/trigger.ts:65

Variables

iconUrls

Const iconUrls: Object

Icon URL's

Type declaration

NameTypeDescription
supportAgentstringSupport agent icon
callEndstringCall end icon
multimodalstringMultimodal icon

Defined in

voice-plus-web/src/ui/components/icons.tsx:12

Functions

run

run(props): Promise<RunOutput>

Run the Voice+ script

Parameters

NameTypeDescription
propsRunPropsThe run configuration object

Returns

Promise<RunOutput>

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

Defined in

voice-plus-web/src/index.ts:84

Interfaces

Interface: ButtonConfig

Button configuration

Properties

label

label: string

Button label

Defined in

voice-plus-web/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

voice-plus-web/src/configuration.ts:66


iconUrl

Optional iconUrl: string

Icon URL

Defined in

voice-plus-web/src/configuration.ts:70


onClick

onClick: (config: HandlerArg) => void

Click handler

Type declaration

▸ (config): void

Parameters
NameType
configHandlerArg
Returns

void

Defined in

voice-plus-web/src/configuration.ts:74

Interface: EncodedQuery

Encoded query

Properties

name

name: Method

Query name

Defined in

voice-plus-web/src/queries.ts:60


target

target: string | SerializedRegex

Query target

Defined in

voice-plus-web/src/queries.ts:64


options

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

Query options

Defined in

voice-plus-web/src/queries.ts:68


parent

parent: null | EncodedQuery

Query parent

Defined in

voice-plus-web/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

voice-plus-web/src/index.ts:72


client

client: Client

The regular Voice+ SDK client

Defined in

voice-plus-web/src/index.ts:76

Interface: RunProps

Configuration for the run method

Properties

config

config: Config

The regular Voice+ configuration

Defined in

voice-plus-web/src/index.ts:45


ui

Optional ui: UiConfig

UI configuration

Defined in

voice-plus-web/src/index.ts:49


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

voice-plus-web/src/index.ts:54


onDigression

Optional onDigression: (client: Client) => void

Digression detection callback

Type declaration

▸ (client): void

Parameters
NameType
clientClient
Returns

void

Defined in

voice-plus-web/src/index.ts:58


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

voice-plus-web/src/index.ts:62

Interface: SerializedRegex

Serialized regex

Properties

regexp

regexp: string

Regex body

Defined in

voice-plus-web/src/queries.ts:46


flags

flags: string

Regex flags

Defined in

voice-plus-web/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

voice-plus-web/src/configuration.ts:46

Interface: Theme

Visual theme for the UI

Properties

colors

Optional colors: ThemeColors

UI colors

Defined in

voice-plus-web/src/configuration.ts:28


fontFamily

Optional fontFamily: string

Font family

Defined in

voice-plus-web/src/configuration.ts:32

Interface: ThemeColors

Theme colors

Properties

primary

Optional primary: string

Primary color

Defined in

voice-plus-web/src/configuration.ts:10


primaryHover

Optional primaryHover: string

Primary color on hover

Defined in

voice-plus-web/src/configuration.ts:14


highlight

Optional highlight: string

Color for trigger highlights

Defined in

voice-plus-web/src/configuration.ts:18

Interface: Trigger

A single trigger

Properties

event

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

Event

Defined in

voice-plus-web/src/trigger.ts:14


query

Optional query: EncodedQuery

A query identifying the element

Defined in

voice-plus-web/src/trigger.ts:18


once

Optional once: boolean

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

Defined in

voice-plus-web/src/trigger.ts:22


highlight

Optional highlight: boolean

A flag specifying whether the trigger should highlight. Only applicable to click triggers.

Defined in

voice-plus-web/src/trigger.ts:26


urlCondition

Optional urlCondition: UrlCondition

URL condition

Defined in

voice-plus-web/src/trigger.ts:30

Interface: TriggeredStep

Represents a load step that has already been triggered.

Properties

stepId

stepId: string

step id

Defined in

voice-plus-web/src/configuration.ts:38


url

url: string

the URL of the page it triggered on

Defined in

voice-plus-web/src/configuration.ts:40

Interface: UiConfig

Full UI configuration

Properties

title

title: string

Drawer title

Defined in

voice-plus-web/src/configuration.ts:84


subtitle

subtitle: string

Drawer subtitle

Defined in

voice-plus-web/src/configuration.ts:88


highlights

Optional highlights: boolean

Render highlights

Defined in

voice-plus-web/src/configuration.ts:92


iconUrl

Optional iconUrl: string

URL for the button icon

Defined in

voice-plus-web/src/configuration.ts:101


theme

Optional theme: Theme

UI theme

Defined in

voice-plus-web/src/configuration.ts:105


onEscalation

Optional onEscalation: (config: SimpleHandlerArg) => void

Escalation handler

Type declaration

▸ (config): void

Parameters
NameType
configSimpleHandlerArg
Returns

void

Defined in

voice-plus-web/src/configuration.ts:109


escalationButtonLabel

Optional escalationButtonLabel: string

Escalation button label

Defined in

voice-plus-web/src/configuration.ts:113


escalationConfirmation

Optional escalationConfirmation: string

Escalation confirmation

Defined in

voice-plus-web/src/configuration.ts:117


onEnd

Optional onEnd: (config: SimpleHandlerArg) => void

End handler

Type declaration

▸ (config): void

Parameters
NameType
configSimpleHandlerArg
Returns

void

Defined in

voice-plus-web/src/configuration.ts:121


endButtonLabel

Optional endButtonLabel: string

End button label

Defined in

voice-plus-web/src/configuration.ts:125


endConfirmation

Optional endConfirmation: string

End confirmation

Defined in

voice-plus-web/src/configuration.ts:129


onPreviousStep

Optional onPreviousStep: (config: HandlerArg) => void

On previous step

Type declaration

▸ (config): void

Parameters
NameType
configHandlerArg
Returns

void

Defined in

voice-plus-web/src/configuration.ts:133


previousStepButtonLabel

Optional previousStepButtonLabel: string

Previous step button label

Defined in

voice-plus-web/src/configuration.ts:137


buttons

Optional buttons: ButtonConfig[]

Custom buttons

Defined in

voice-plus-web/src/configuration.ts:141


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

voice-plus-web/src/configuration.ts:146


nudgeShowAfterMs

Optional nudgeShowAfterMs: number

Show nudge tooltip after this many milliseconds

Defined in

voice-plus-web/src/configuration.ts:150


nudgeHideAfterMs

Optional nudgeHideAfterMs: number

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

Defined in

voice-plus-web/src/configuration.ts:154

Interface: UrlCondition

URL match condition

Properties

operator

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

Condition operator

Defined in

voice-plus-web/src/UrlCondition.ts:8


value

value: string

Condition value

Defined in

voice-plus-web/src/UrlCondition.ts:12