npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nlxai/connect-chat-adapter

v1.2.7-alpha.4

Published

Amazon Connect Chat adapter for Touchpoint UI

Downloads

157

Readme

Amazon Connect Chat Adapter

An adapter that connects Amazon Connect Chat to Touchpoint UI, allowing you to use NLX's Touchpoint widget as the frontend for an Amazon Connect contact flow.

Getting started

npm i --save @nlxai/connect-chat-adapter

Usage

1. Fetch chat details

Before creating a conversation, you need to obtain chat details by calling the StartChatContact API via your backend endpoint:

import { fetchChatDetails } from "@nlxai/connect-chat-adapter";

const details = await fetchChatDetails("https://your-api-gateway-endpoint/start-chat", {
  instanceId: "your-connect-instance-id",
  contactFlowId: "your-contact-flow-id",
  participantDisplayName: "Customer",
});

2. Create the conversation handler

import { createConnectChatConversation } from "@nlxai/connect-chat-adapter";
import { create } from "@nlxai/touchpoint-ui";

const touchpoint = await create({
  conversationHandler: createConnectChatConversation({
    details,
    region: "us-east-1",
  }),
  theme: { accent: "#0972d3" },
});

Configuration

ConnectChatConfig

| Property | Type | Required | Description | | --- | --- | --- | --- | | details | ChatDetails | Yes | Chat details from a prior StartChatContact call | | region | string | No | AWS region (defaults to "us-west-2") | | languageCode | LanguageCode | No | Language code for the conversation | | globalConfig | Record<string, unknown> | No | Global config passed to connect.ChatSession.setGlobalConfig() |

ChatDetails

| Property | Type | Description | | --- | --- | --- | | contactId | string | The contact ID | | participantId | string | The participant ID | | participantToken | string | The participant token used for authentication |

DetailsParams

| Property | Type | Required | Description | | --- | --- | --- | --- | | instanceId | string | No | Connect instance ID | | contactFlowId | string | No | Contact flow ID to use | | participantDisplayName | string | No | Customer display name | | contactAttributes | Record<string, string> | No | Contact attributes passed to the contact flow | | supportedMessagingContentTypes | string[] | No | Content types the participant supports receiving |

API reference

Functions

fetchChatDetails()

function fetchChatDetails(endpoint, params): Promise<ChatDetails>;

Fetch chat details via API Gateway endpoint

Parameters

endpoint

string

params

DetailsRequestParams

Returns

Promise<ChatDetails>


createConnectChatConversation()

function createConnectChatConversation(config): ConversationHandler;

Creates a ConversationHandler backed by Amazon Connect Chat via amazon-connect-chatjs.

Parameters

config

ConnectChatConfig

{ConnectChatConfig} - configuration

Returns

ConversationHandler

conversationHandler {ConversationHandler} - @nlxai/core-compatible conversation handler, directly passable to Touchpoint UI.

Example

import { createConnectChatConversation } from "@nlxai/connect-chat-adapter";
import { create } from "@nlxai/touchpoint-ui";

const touchpoint = await create({
  conversationHandler: createConnectChatConversation({
    details: {
      contactId: "abc-123",
      participantId: "def-456",
      participantToken: "token-xyz",
    },
    region: "us-east-1",
  }),
  theme: { accent: "#0972d3" },
});

Interfaces

ConnectChatConfig

Configuration for the Amazon Connect Chat adapter.

No AWS access keys or secret keys are required client-side. Authentication is handled via the participant token returned by the StartChatContact API.

Chat details are obtained via the fetchChatDetails call.

Properties

details
details:
  | ChatDetails
  | (() => Promise<ChatDetails>);

Pre-obtained chat details from a prior StartChatContact call.

region?
optional region?: string;

AWS region (e.g., "us-east-1"). Defaults to "us-west-2".

languageCode?
optional languageCode?: string;

Language code for the conversation

globalConfig?
optional globalConfig?: Record<string, unknown>;

Optional global config to pass to connect.ChatSession.setGlobalConfig(). See the AmazonConnectChatJS documentation for available options.


ChatDetails

Chat details

Properties

contactId
contactId: string;

The contact ID

participantId
participantId: string;

The participant ID

participantToken
participantToken: string;

The participant token used for authentication


DetailsRequestParams

Parameters to pass when calling the startChatEndpoint.

Properties

instanceId?
optional instanceId?: string;

Connect instance ID

contactFlowId?
optional contactFlowId?: string;

Contact flow ID to use

participantDisplayName?
optional participantDisplayName?: string;

Customer display name

contactAttributes?
optional contactAttributes?: Record<string, string>;

Contact attributes passed to the contact flow

supportedMessagingContentTypes?
optional supportedMessagingContentTypes?: string[];

Content types the chat participant supports receiving. Defaults to text/plain, text/markdown, application/json, and interactive messages.