SDK Reference
SDK Reference
Interfaces
Setup
create
▸ create(options
): Client
The starting point of the package. Call create to create a Voice+ client.
Parameters
Returns
a Voice+ client
Example
const client = nlxai.voicePlus.create({
// hard-coded params
apiKey: "REPLACE_WITH_API_KEY",
workspaceId: "REPLACE_WITH_WORKSPACE_ID",
scriptId: "REPLACE_WITH_SCRIPT_ID",
// dynamic params
conversationId: "REPLACE_WITH_CONVERSATION_ID",
languageCode: "en-US",
});
client.sendStep("REPLACE_WITH_STEP_ID");
Defined in
Client
Context
Ƭ Context: Record
<string
, any
>
context to send back to the voice bot, for usage later in the intent.
Defined in
Other
StepInfo
Ƭ StepInfo: string
| { stepId
: string
; stepTriggerDescription?
: string
}
Step information, either a step ID as a single string or an object
Defined in
Interfaces
Interface: Client
The Voice+ client
Properties
sendStep
• sendStep: (step
: StepInfo
, context?
: Context
) => Promise
<void
>
Example
const client = nlxai.voicePlus.create({
// hard-coded params
apiKey: "REPLACE_WITH_API_KEY",
workspaceId: "REPLACE_WITH_WORKSPACE_ID",
scriptId: "REPLACE_WITH_SCRIPT_ID",
// dynamic params
conversationId: "REPLACE_WITH_CONVERSATION_ID",
languageCode: "en-US",
});
client.sendStep("REPLACE_WITH_STEP_ID", { selectedSeat: "4a" });
sends a step to the voice bot
Type declaration
▸ (step
, context?
): Promise
<void
>
Parameters
Returns
Promise
<void
>
Defined in
Interface: Config
Initial configuration used when creating a journey manager
Properties
apiKey
• apiKey: string
the API key generated for the journey.
Defined in
journeyId
• Optional
journeyId: string
The ID of the journey.
Deprecated
use scriptId
instead
Defined in
scriptId
• Optional
scriptId: string
the ID of the script.
Defined in
workspaceId
• workspaceId: string
your workspace id
Defined in
conversationId
• conversationId: string
the conversation id, passed from the active voice bot.
Note: This must be dynamically set by the voice bot.
Defined in
languageCode
• languageCode: string
the user's language code, consistent with the language codes defined on the journey.
Defined in
debug
• Optional
debug: boolean
set to true to help debug issues or errors. Defaults to false
Defined in
Last updated