Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Supported widget snippet fields in Amazon Connect that are customizable - Amazon Connect

Supported widget snippet fields in Amazon Connect that are customizable

The following table lists the communications widget snippet fields that you can customize. Example code after the table shows how to use the snippet fields.

Snippet field Type Description Additional documentation

snippetId

String

Mandatory, auto-generated

n/a

styles

String

Mandatory, auto-generated

n/a

supportedMessagingContentTypes

Array

Mandatory, auto-generated

n/a

customLaunchBehavior

Object

Customize how your website renders and launches the hosted widget icon

Customize widget launch behavior and button icon for your website hosted in Amazon Connect, later in this topic

authenticate

Function

Callback function to enable JWT security on your website

Step 2: Specify the website domains where you expect to display the communications widget, earlier in this section.

customerDisplayName

Function

Pass the customer display name when initializing a contact

Pass the customer display name when an Amazon Connect chat starts, later in this section.

customStyles

Object

Override the default CSS styles

Pass custom properties to override the defaults in the communications widget in Amazon Connect, later in this section.

chatDurationInMinutes

Number

The total duration of the newly started chat session

Default: 1500 - Min 60, Max: 10080

enableLogs

Boolean

Enable the debugging logs

Default: false

language

String

Connect can do translations for supported ISO-639 format language codes. For more information, see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.

Default: en_US. Supported: 'de_DE', 'en_US', 'es_ES', 'fr_FR', 'id_ID', 'it_IT', 'ja_JP', 'ko_KR', 'pt_BR', 'zh_CN'

nonce

String

Handshake value between iframe and customer website csp policy. Example: customer csp allows 1234 nonce value, iframe which pulls in another script must have the same 1234 nonce value so that browser knows it is a trusted script by iframe parent site.

Default: undefined

customizationObject

Object

Customize the widget layout and transcript

For more information, see Additional customizations for your Amazon Connect chat widget, later in this section.

contactAttributes

Object

Pass attributes to the contact flow directly from snippet code, without any JWT setup

For more information, see Pass contact attributes when a chat initializes.

customDisplayNames

Object

Override the System or Bot display name and logo configurations set in the Amazon Connect admin website.

For more information, see How to pass override system and bot display names and logos for the communications widget .

contactMetadataHandler

Function

Callback function to access contactId. For example, add an event listener to handle scenarios like calling the StopContact function with the contactId when the browser tab is closed or maintaining chat persistence with a previous contactId.

For more information, see Persistent Chat Demo using `contactMetadataHandler` .

registerCallback

Object

This allows to execute callbacks for the exposed lifecycle events.

Exposed events are 'PARTICIPANT_IDLE' , 'CHAT_ENDED', 'PARTICIPANT_RETURNED', 'PARTICIPANT_JOINED', 'PARTICIPANT_LEFT', 'CONNECTION_ESTABLISHED','CONNECTION_LOST', and 'AUTHENTICATION_INITIATED'. AUTHENTICATION_INITIATED callback is executed when the contact reaches the Authenticate Customer flow block.

initialMessage

String

Message to be sent to the newly created chat. Length Constraints: Minimum of 1, Maximum of 1024.

To invoke the Lex bot configured in the contact flow using an initial message, modify the Get customer input flow block by selecting the Initialize bot with message option. For more information, see How to configure Get customer input flow block.

authenticationParameters

Object

This enables the Authenticate Customer flow block

For more information, see Enable customer authentication.

mockLexBotTyping

Boolean

Enable mocking typing indicator for Lex Bot messages.

Default: false

The following example shows how to add snippet fields to the HTML script that adds the chat widget to your web site.

(function(w, d, x, id){ /* ... */ })(window, document, 'amazon_connect', 'widgetId'); amazon_connect('snippetId', 'snippetId'); amazon_connect('styles', /* ... */); amazon_connect('registerCallback', { 'event_Name_1' : callback(function), 'event_Name_2' : callback(function), ... }); amazon_connect('initialMessage', 'Your initial message string'); // ... amazon_connect('snippetFieldHere', /* ... */); <script/>
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.