Developers

Voice+

API reference

@nlxai/voice-plus-core

Interfaces

Setup

create

create(options): Client

The starting point of the package. Call create to create a Voice+ client.

Parameters

NameTypeDescription
optionsConfigconfiguration options for the client

Returns

Client

a Voice+ client

Example

1 const client = nlxai.voicePlus.create({ 2 // hard-coded params 3 apiKey: "REPLACE_WITH_API_KEY", 4 workspaceId: "REPLACE_WITH_WORKSPACE_ID", 5 scriptId: "REPLACE_WITH_SCRIPT_ID", 6 // dynamic params 7 conversationId: "REPLACE_WITH_CONVERSATION_ID", 8 languageCode: "en-US", 9}); 10 11client.sendStep("REPLACE_WITH_STEP_ID");

Defined in

index.ts:26


Client

Context

Ƭ Context: Record<string, any>

context to send back to the voice bot, for usage later in the intent.

Defined in

index.ts:121

Interfaces

Interface: Client

The Voice+ client

Properties

sendStep

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

Example

1 const client = nlxai.voicePlus.create({ 2 // hard-coded params 3 apiKey: "REPLACE_WITH_API_KEY", 4 workspaceId: "REPLACE_WITH_WORKSPACE_ID", 5 scriptId: "REPLACE_WITH_SCRIPT_ID", 6 // dynamic params 7 conversationId: "REPLACE_WITH_CONVERSATION_ID", 8 languageCode: "en-US", 9}); 10 11client.sendStep("REPLACE_WITH_STEP_ID", {selectedSeat: "4a"});

sends a step to the voice bot

Type declaration

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

Parameters
NameTypeDescription
stepIdstringthe next step to transition to. Note: Must be a valid UUID
context?Contextcontext to send back to the voice bot, for usage later in the intent.
Returns

Promise<void>

Defined in

index.ts:114

Interface: Config

Initial configuration used when creating a journey manager

Properties

apiKey

apiKey: string

  • the API key generated for the journey.
Defined in

index.ts:129


journeyId

Optional journeyId: string

The ID of the journey.

Deprecated

use scriptId instead

Defined in

index.ts:134


scriptId

Optional scriptId: string

the ID of the script.

Defined in

index.ts:136


workspaceId

workspaceId: string

your workspace id

Defined in

index.ts:139


conversationId

conversationId: string

the conversation id, passed from the active voice bot.

Note: This must be dynamically set by the voice bot.

Defined in

index.ts:146


languageCode

languageCode: string

the user's language code, consistent with the language codes defined on the journey.

Defined in

index.ts:151


debug

Optional debug: boolean

set to true to help debug issues or errors. Defaults to false

Defined in

index.ts:154