Supported widget snippet fields - Amazon Connect

Supported widget snippet fields

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, 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 a chat initializes, later in this section.

customStyles

Object

Override the default CSS styles

Pass custom properties to override the defaults in the communications widget, 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 chat customizations, 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 .

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

<script type="text/javascript"> (function(w, d, x, id){ /* ... */ })(window, document, 'amazon_connect', 'widgetId'); amazon_connect('snippetId', 'snippetId'); amazon_connect('styles', /* ... */); // ... amazon_connect('snippetFieldHere', /* ... */) <script/>