You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library can be used by customers to place a chat Button or Icon, chat form, and a chat widget at the bottom right of their website. When this library is imported, using a script tag in the customers web page, it will expose AmazonCustomChatWidget.ChatInterface.init method to the global window DOM object. This method can be invoked with various properties, to get the Amazon Connect Chat in the website.
5
+
Custom Chat Widget is a JavaScript library that enables you to place a Chat Button (or Icon), Chat Form, and Chat Widget at your website. When this library is imported, using `script` tag in a web page, it exposes `AmazonCustomChatWidget.ChatInterface.init()` method to the global `window` object. This method can be invoked with various properties, to get the Amazon Connect Chat in the website.
6
6
7
-
Customers who would like to use Amazon Connect Chat do not have to develop their chat widget from scratch, and worry about styling and positioning the chat widget with a chat form on their webpage. This plug-in takes care of styling and positioning the chat widget on your webpage with ease. On top of that, customers also have the flexibility to customize this library, if needed.
7
+
Custom Chat Widget library simplifies the process of embedding, styling, and positioning Chat widget, with Chat Form, on your web page. On top of that, you also have a flexibility to customize this library, according to your business requirements.
8
8
9
-
Below steps explain how Chat Widget works on a webpage
9
+
Below steps explain how Custom Chat Widget works on a web page
10
10
11
-
1.Customers have an option to have a button or an icon on their webpage.
11
+
1.To enable customers to start a new Chat on your web page, you could either use `ChatIcon` or `ChatButton`.
3. When this form is submitted by the user, the Chat Widget opens (Widget) that connects with Amazon Connect, for self service, and/or transfer to a chat agent..
23
+
3. When this form is submitted by the customer, Custom Chat Widget opens and starts a new Chat contact, for self service, and/or transfer to a chat agent.
- Amazon Connect instance, ready to receive chats.
30
+
[Refer to : Enabling Chat in Existing Amazon Connect Contact Center section in this link](../README.md#enabling-chat-in-an-existing-amazon-connect-contact-center)
28
31
29
-
[Refer to : Enabling Chat in Existing Amazon Connect Contact Center section in this link](https://github.com/amazon-connect/chatPluginForWebpage/public/amazon-connect-chat-interface.js)
32
+
- An Amazon Connect Contact Flow, ready to receive chat contacts.
33
+
[Refer to this link on how to create a Contact Flow for Chat](https://docs.aws.amazon.com/connect/latest/adminguide/chat.html)
30
34
31
-
- An Amazon Connect Contact Flow ready to receive chats.
32
-
33
-
[Refer to this link on how to create a contact flow for chat](https://docs.aws.amazon.com/connect/latest/adminguide/chat.html)
34
-
35
-
- Amazon Connect Chat backend. Please use the below link to deploy the chat backend
-After ACChat.js is imported, it will expose AC.ChatInterface.init() method. This method can be invoked with certain properties, to place Amazon Connect Chat Widget on your website.
51
+
-Once `ACChat.js` is imported, it exposes `AmazonCustomChatWidget.ChatInterface.init()` method. This method can be invoked with certain properties, to place Custom Chat Widget on a web page.
53
52
- Below description explains each of those properties
54
53
55
-
1. containerId : Specify the html element ID where you would want to load the chat widget. Preferable to use the root ID# of the Body.
56
-
2. initiationIcon: Can be 'icon' or 'button'.
57
-
3. region: Specify the region where the API gateway was deployed. This property is used to access API gateway.
58
-
4. name: Specify the name of the customer, this will be utilized during chat creation. This field is mandatory. It can have the below values:
54
+
1.`containerId` : Specify a HTML Element ID, where Custom Chat Widget is going to be placed. Preferably, provide the root ID# of the document body.
55
+
2.`initiationIcon`: Can be set as `icon` or `button`.
56
+
3.`region`: Specify the region where Amazon API Gateway was deployed.
57
+
4.`name`: Specify customer's name, which is passed during Chat initiation. This field is mandatory. It can have one of the below values:
59
58
60
59
- A variable
61
60
- A constant
62
-
- Refer to the form input field `Name` like this: "refer|inputFields|Name".
61
+
- Refer to the form input field `Name` like this: `refer|inputFields|Name`.
63
62
64
-
5. username: Specify the username of the customer , this will will also be utilized during during chat creation. This field is mandatory. It can have the below values:
63
+
5.`username`: Specify customer's username, which is passed during Chat initiation. This field is mandatory. It can have one of the below values:
65
64
66
65
- A variable
67
66
- A constant
68
-
- Refer to the input field `UserName` like this: "refer|inputFields|UserName".
69
-
70
-
6. apiGateway: Provide the API Gateway URL for your Amazon Connect Chat backend that was deployed using the Cloudformation template.
67
+
- Refer to the input field `UserName` like this: `refer|inputFields|UserName`.
6.`apiGateway`: Provide Amazon API Gateway URL for your Amazon Connect Chat backend, that was deployed using the Cloudformation template. (`https://${apiId}.execute-api.${region}.amazonaws.com/Prod`)
73
70
74
-
7. Amazon Connect Contact Flow Id: Provide the contact flow ID and not the ARN.
71
+
7.`contactFlowId`: Provide Amazon Connect Contact Flow ID (not full ARN).
75
72
76
73
For example: If the Contact flow ARN : `arn:aws:connect:<region>:111111111111:instance/11111111-1111-1111-1111-1111111111/contact-flow/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX`, then the contact flow ID will be `XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX`.
77
74
78
-
8.Amazon Connect Instance Id: Provide your amazon connect instance ID and not the ARN.
75
+
8.`instanceId`: Provide your Amazon Connect Instance ID (not full ARN).
79
76
80
77
For example: If the Instance ARN : `arn:aws:connect:<region>:11111111111111:instance/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX` , then the instance ID will be `XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX`.
81
78
82
-
9. contactAttr: This is an object that can have keys and values. Basically these attributes will be sent to your contact flow during chat initiation.
79
+
9.`contactAttr`: This is an object that can have keys and values. Basically, these attributes will be sent to your Contact Flow during chat initiation.
83
80
84
-
10. preChatForm: This form can be used in identifying the customer, by collecting customer's information, like their name or email. These attributes can also be sent to the Amazon Connect Contact Flow, so we don't have to identify the customer again in the bot, and can just proceed with verification. This will help to reduce Average Handle Time (AHT). This field is not mandatory. If not provided, no chat form will be presented to the customer.
81
+
10.`preChatForm`: This form can be used in identifying your customer, by collecting customer's information, like their name or email. These attributes can also be sent to Amazon Connect Contact Flow, so we don't have to identify the customer again in the bot, and can just proceed with verification. This helps to reduce Average Handle Time (AHT). This field is not mandatory. If not provided, no chat form will be presented to the customer.
85
82
86
-
- visible: This can set to true/false.
87
-
- inputFields: An array of objects. Each object has a name and a validation field. The name represents the label of the input field in the form and the validation field can be `required` or `notrequired`.
83
+
-`visible`: This can set to `true` or `false`.
84
+
-`inputFields`: An array of objects. Each object has `name` and `validation` field. The `name` represents the label of the input field in `ChatForm`, and the `validation` field can be set as`required` or `notrequired`.
88
85
89
86
```js
90
87
preChatForm:{
91
88
visible:true,
92
89
inputFields:[
93
90
{
94
-
name:"Name",
95
-
validation:"required"
91
+
name:"Name",
92
+
validation:"required"
96
93
},
97
94
{
98
-
name:"UserName",
99
-
validation:"required"
95
+
name:"UserName",
96
+
validation:"required"
100
97
},
101
98
{
102
-
name:"Email",
103
-
validation:"notrequired"
99
+
name:"Email",
100
+
validation:"notrequired"
104
101
}
105
102
]
106
103
}
107
104
108
105
```
109
106
110
-
11. primaryColor: Specify the color ofthe Icon/Button, form and the chat widget.
107
+
11.`primaryColor`: Specify the color of`ChatIcon` or `ChatButton`, then `ChatForm`and `ChatWidget`.
111
108
112
-
12. description: Specify the description that will be displayed inthe chat widget.
109
+
12.`description`: Specify the description that will be displayed in`ChatWidget`.
113
110
114
-
- Below is a simple example on how ACChat can be invoked in a html page:
111
+
- Below is a simple example on how `ACChat` can be invoked in a HTML page:
name: 'refer|inputFields|Name', // **** Mandatory**** Add a constant or a variable for chat without form or if you have a form then you can refer it to the input fields like "refer|inputFields|Name"
138
134
username: 'refer|inputFields|UserName', // **** Mandatory**** Add a constant or a variable for chat without form or if you have a form then you can refer it to the input fields like "refer|inputFields|UserName"
139
-
apiGateway:
140
-
'https://<XXXXXXXXX>.execute-api.us-east-1.amazonaws.com/Prod' /* API Gateway URI */,
135
+
apiGateway: 'https://<XXXXXXXXX>.execute-api.us-east-1.amazonaws.com/Prod' /* API Gateway URI */,
141
136
contactFlowId: 'XXXXXX-XXXX-XXX-XXX-XXXXXXX',
142
137
instanceId: 'XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX',
143
138
contactAttr: {
144
-
someKey1: 'someValue1',
145
-
someKey2: 'someValue2',
139
+
sampleKey1: 'sampleValue1',
140
+
sampleKey2: 'sampleValue2',
146
141
},
147
142
preChatForm: {
148
143
visible: true,
@@ -170,24 +165,24 @@ Below steps explain how Chat Widget works on a webpage
170
165
</html>
171
166
```
172
167
173
-
## How to customize ACChat.js
168
+
## How to customize the widget
174
169
175
-
- The source code forACChat.jsin/chatPluginForWebpage/src folder can be used to customize Chat Icon , Chat Button and the Chat Form.
170
+
- The source code in`/customChatWidget/src` folder can be used to customize `ChatIcon` , `ChatButton`and `ChatForm`.
176
171
177
172
- In your Terminal, clone the repo:`git clone https://github.com/amazon-connect/amazon-connect-chat-ui-examples.git`
178
173
179
-
- Go to /customChatWidget.
174
+
- Go to `/customChatWidget`.
180
175
181
-
- Run `npm install` to install node_modules.
176
+
- Run `npm install` to install `node_modules`.
182
177
183
-
-Now You can customize any of the components in`chatPluginForWebpage/src/components` according to your needs.
178
+
- You can now customize any of the components in`customChatWidget/src/components` according to your business requirements.
184
179
185
-
- Run `npm run build` to build a production package using Babel. The build process produces minified ACChat.js file, and stores it into the publicfolder. Please note that webpack.dev.js produces a development version, which includes consolelogs. For a production build, please use webpack.prod.js.
180
+
- Run `npm run build` to build a production package, using Babel. The build process produces minified `ACChat.js` file, and stores it into `public`folder. Please note that `webpack.dev.js` produces a development version, which includes consolelogs. For a production build, please use `webpack.prod.js`.
186
181
187
-
- For testing, run `npm run dev-build` to build a dev package using babel and webpack.dev.js and saves the built minified file into the public folder with name ACChat.js. The dev version will have console logs.
182
+
- For testing, run `npm run dev-build` to build a dev package using Babel and `webpack.dev.js` and saves the built minified file into the `public` folder with name `ACChat.js`. The dev version will have console logs.
188
183
189
184
## Testing
190
185
191
-
- Once the build has completed, you can test index.htmlin/chatPluginForWebpage/public, using `Live Server` extensionif you are using VS Code.
186
+
- Once the build has completed, you can test `index.html`in`/customChatWidget/public`, using *Live Server* extension, in case you are using VS Code.
192
187
193
188
[VS Code Live Server Extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
0 commit comments