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
{{ message }}
This repository was archived by the owner on Oct 16, 2018. It is now read-only.
Can be `true` to use natural typing speed (based on characters length) or can also be a natural time string (parsed by [`ms module`](https://www.npmjs.com/package/ms)).
34
37
38
+
#### `markdown` (optional)
39
+
40
+
Can be `true` to render the text as markdown format. This allows you to include links, bold and italic text.
41
+
35
42
#### `web-style` (optional)
36
43
37
44
`web-style` (optional) will pass the arguments as [DOM style](https://www.w3schools.com/jsref/dom_obj_style.asp) properties. This allows you to customize how specific messages look.
@@ -53,8 +60,8 @@ Array of string, with the `<PAYLOAD> Text` format.
You can always catch formId in the hear function, because Id is not an option in the form element. You choose a value to go with your id keys.
101
+
You can always catch formId in the hear function, because Id is not an option in the form element. You choose a value to go with your id keys.
94
102
95
103
```yaml
96
-
welcome:
104
+
welcome:
97
105
- text: "Welcome"
98
106
typing: 250ms
99
107
form:
@@ -104,7 +112,7 @@ welcome:
104
112
105
113
106
114
form-email:
107
-
- text: Provide me your email
115
+
- text: Provide me your email
108
116
form:
109
117
title: Email
110
118
id: email
@@ -113,7 +121,6 @@ form-email:
113
121
#
114
122
```
115
123
116
-
117
124
in your `bp.hear` function
118
125
119
126
```js
@@ -136,6 +143,7 @@ Has a same attributes like `input`, but has no `subtype` attribute
136
143
Has a same attributes like `textarea`, but has no `maxlength` and `minlength` attributes, and has `options` attribute, which contain an option elements.
137
144
138
145
Example:
146
+
139
147
```yaml
140
148
- select:
141
149
label: Select one item
@@ -158,10 +166,8 @@ Example:
158
166
159
167
</details>
160
168
161
-
162
169
<details>
163
170
<summary><b>Carousel</b></summary>
164
-
165
171
166
172
#### `elements` (required)
167
173
@@ -196,22 +202,22 @@ Settings to pass the [`react-slick`](https://github.com/akiran/react-slick) comp
196
202
In your `index.js` file, add this:
197
203
198
204
```js
199
-
const config = {
200
-
botName: '<<REPLACE>>',
201
-
botAvatarUrl: '<<REPLACE BY URL>>',
202
-
botConvoTitle: '<<REPLACE>>',
203
-
botConvoDescription: "<<REPLACE>>",
204
-
backgroundColor: '#ffffff',
205
-
textColorOnBackground: '#666666',
206
-
foregroundColor: '#000000',
207
-
textColorOnForeground: '#ffffff'
208
-
}
209
-
210
-
bp.createShortlink('chat', '/lite', {
211
-
m: 'channel-web',
212
-
v: 'fullscreen',
213
-
options: JSON.stringify({ config: config })
214
-
})
205
+
const config = {
206
+
botName: '<<REPLACE>>',
207
+
botAvatarUrl: '<<REPLACE BY URL>>',
208
+
botConvoTitle: '<<REPLACE>>',
209
+
botConvoDescription: '<<REPLACE>>',
210
+
backgroundColor: '#ffffff',
211
+
textColorOnBackground: '#666666',
212
+
foregroundColor: '#000000',
213
+
textColorOnForeground: '#ffffff'
214
+
}
215
+
216
+
bp.createShortlink('chat', '/lite', {
217
+
m: 'channel-web',
218
+
v: 'fullscreen',
219
+
options: JSON.stringify({ config: config })
220
+
})
215
221
```
216
222
217
223
**Now your bot is available at the following url: `<BOT_URL>/s/chat`, e.g. `http://localhost:3000/s/chat`.**
@@ -228,19 +234,20 @@ To embedded the web interface to a website, you simply need to add this script a
228
234
```
229
235
230
236
## Customize the look and feel
237
+
231
238
You can customize look and feel of the web chat by passing additional keys to `init` method like this:
232
239
233
240
```javascript
234
241
window.botpressWebChat.init({
235
242
host: '<host>',
236
-
botName: 'Bot', // Name of your bot
237
-
botAvatarUrl: null, // Default avatar url of the image (e.g. 'https://avatars3.githubusercontent.com/u/1315508?v=4&s=400' )
243
+
botName: 'Bot', // Name of your bot
244
+
botAvatarUrl: null, // Default avatar url of the image (e.g. 'https://avatars3.githubusercontent.com/u/1315508?v=4&s=400' )
238
245
botConvoTitle: 'Technical Support', // Title of the first conversation with the bot
239
246
botConvoDescription: '',
240
-
backgroundColor: '#ffffff', // Color of the background
241
-
textColorOnBackground: '#666666', // Color of the text on the background
242
-
foregroundColor: '#0176ff', // Element background color (header, composer, button..)
243
-
textColorOnForeground: '#ffffff' // Element text color (header, composer, button..)
247
+
backgroundColor: '#ffffff', // Color of the background
248
+
textColorOnBackground: '#666666', // Color of the text on the background
249
+
foregroundColor: '#0176ff', // Element background color (header, composer, button..)
250
+
textColorOnForeground: '#ffffff' // Element text color (header, composer, button..)
0 commit comments