@2uinc/frontend-component-xpert-chatbot 1.2.0-beta.2 → 1.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -10
- package/dist/lib/index.min.js +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -14,9 +14,11 @@ The Xpert Chatbot Frontend component library purpose is to:
|
|
14
14
|
See `#project-xpert-platform` via Slack for more info.
|
15
15
|
|
16
16
|
## Places it's currently deployed
|
17
|
+
|
17
18
|
See `src/client_configurations` folder
|
18
19
|
|
19
20
|
## Features included
|
21
|
+
|
20
22
|
- Configurable ux, logos, disclaimer, privacy policy, prompts and chat api endpoint
|
21
23
|
- Chatbot launch button
|
22
24
|
- Proactive message to enage visitors
|
@@ -33,6 +35,7 @@ This project was created with the following:
|
|
33
35
|
See `package.json` for more info.
|
34
36
|
|
35
37
|
## To view component library demo and develop (entry point `src/demo.jsx`):
|
38
|
+
|
36
39
|
1. Install dependencies:
|
37
40
|
```
|
38
41
|
npm i
|
@@ -51,13 +54,14 @@ npm start
|
|
51
54
|
`
|
52
55
|
|
53
56
|
## To verify components within `/dist` folder via script tag:
|
57
|
+
|
54
58
|
1. Install serve
|
55
59
|
```
|
56
60
|
npm i -g serve
|
57
61
|
```
|
58
|
-
2. Serve `/dist` folder
|
62
|
+
2. Build && Serve `/dist` folder
|
59
63
|
```
|
60
|
-
serve -s dist
|
64
|
+
npm run build && serve -s dist
|
61
65
|
```
|
62
66
|
3. Configure chatbot by providing `window.XpertChatbotFrontend.xpertKey` or `window.XpertChatbotFrontend.configurations` within `dist/index.html`. Client configurations are located in `src/client_configurations`.
|
63
67
|
4. Go to `http://localhost:3000/` and verify chatbot works as expected.
|
@@ -84,6 +88,7 @@ npm test
|
|
84
88
|
```
|
85
89
|
|
86
90
|
## Deployment
|
91
|
+
|
87
92
|
We deploy an NPM package to npmjs.org with the name `@2uinc/frontend-component-xpert-chatbot`
|
88
93
|
To install the package, run the following command:
|
89
94
|
|
@@ -91,10 +96,17 @@ To install the package, run the following command:
|
|
91
96
|
$ npm install @2uinc/frontend-component-xpert-chatbot
|
92
97
|
```
|
93
98
|
|
99
|
+
Also add to page head element:
|
100
|
+
|
101
|
+
```
|
102
|
+
<link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />
|
103
|
+
```
|
104
|
+
|
94
105
|
For clients that don't have React, there's the option to pull the resources from CDN.
|
106
|
+
|
95
107
|
```
|
96
108
|
<head>
|
97
|
-
<link rel="stylesheet href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.css
|
109
|
+
<link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />
|
98
110
|
|
99
111
|
<script type="importmap">
|
100
112
|
{
|
@@ -106,16 +118,22 @@ For clients that don't have React, there's the option to pull the resources from
|
|
106
118
|
</script>
|
107
119
|
</head>
|
108
120
|
<body>
|
109
|
-
<div id="xpert-chatbot-container"></div>
|
110
|
-
...
|
111
121
|
<script type="module" defer src="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.js"></script>
|
112
122
|
</body>
|
113
123
|
```
|
114
124
|
|
115
|
-
##### NOTE:
|
116
|
-
Make sure you have a div with the ID `xpert-chatbot-container` for React to render into.
|
117
|
-
|
118
125
|
## Beta releases
|
119
|
-
|
120
|
-
|
126
|
+
|
127
|
+
To create a beta release, make a PR to the `beta` branch. Once the PR is merged, a new beta release will be created and published to npmjs.org with the name:
|
128
|
+
|
129
|
+
```
|
130
|
+
@2uinc/frontend-component-xpert-chatbot@v{tag-name}
|
131
|
+
```
|
132
|
+
|
133
|
+
A CDN release will also be created and published to:
|
134
|
+
|
135
|
+
```
|
136
|
+
https://chatbot-frontend.prod.ai.2u.com/@{tag-name}/index.min.js
|
137
|
+
https://chatbot-frontend.prod.ai.2u.com/@{tag-name}/index.min.css
|
138
|
+
```
|
121
139
|
|
package/dist/lib/index.min.js
CHANGED
@@ -122,7 +122,6 @@ const Jo = {
|
|
122
122
|
xpertKey: "get-smarter",
|
123
123
|
chatApiEndpoint: "https://xpert-platform-services-api.stg.ai.2u.com/xpert/chatservice",
|
124
124
|
userTrackingPrefix: "get.smarter",
|
125
|
-
optimizelyExperimentName: "xpertChatbotExperiment",
|
126
125
|
cookieNamePrefix: "get-smarter",
|
127
126
|
primaryColor: "#e31a82",
|
128
127
|
proactiveMessagePrefix: "Hi!",
|