SDK Integration

Recommended: Use the official NLX SDKs for seamless integration:

  • JavaScript/TypeScript: @nlxai/core - Full conversation management

  • Voice+: @nlxai/touchpoint-ui - Bidirectional voice interactions

  • Voice+ Script: @nlxai/voice-plus-core - Multimodal journey tracking

Quick SDK Setup

Conversation API

import { createConversation } from "@nlxai/core";

const config = {
  applicationUrl: "https://bots.studio.nlx.ai/c/{deploymentKey}/{channelKey}",
  headers: { "nlx-api-key": "your_api_key_here" },
  languageCode: "en-US",
  userId: "user_12345"
};

const conversation = createConversation(config);
conversation.sendText("Hello, I need help with my account");

Voice+ Script API

import { create } from "@nlxai/voice-plus-core";

const client = create({
  apiKey: "your_voice_plus_api_key",
  workspaceId: "your_workspace_id",
  scriptId: "your_script_uuid",
  conversationId: "conversation_from_voice_bot",
  languageCode: "en-US"
});

client.sendStep("step_uuid", { selectedOption: "A" });

Conversation SDK API Methods

SDK Method
API Request
Description

sendText(text, context)

unstructured

Natural language text for NLP processing

sendChoice(choiceId, context)

structured.choiceId

User selection from bot choices

sendFlow(flowId, context)

structured.flowId

Trigger specific conversation flow

sendSlots(slots, context)

structured.slots

Provide slot values directly

sendStructured(request, context)

structured

Complex requests with multiple parameters

sendContext(context)

/context endpoint

Voice+ bidirectional context

Voice+ Script API Methods

SDK Method
API Endpoint
Description

sendStep(stepId, context)

/v1/track

Track progress through multimodal voice journeys

SDK Response Processing

The SDK automatically processes API responses into structured objects:

  • Messages: Text content and user choices

  • Modalities: Rich media components (videos, images, custom components)

  • Context: Variables returned when enabled on flow nodes

  • Metadata: Intent detection, escalation flags, knowledge base sources