1.10.0 • Published 6 days ago

@2uinc/frontend-component-xpert-chatbot v1.10.0

Weekly downloads
-
License
-
Repository
github
Last release
6 days ago

xpert-chatbot-frontend

Purpose

The Xpert Chatbot Frontend component library purpose is to: 1. Generate chatbot code bundle (js, css, etc) for clients to import. 2. Centralize code to keep ux & code quality uniform and high 3. Demonstrate chatbot functionality

Keep in mind this does not expose individual parts of the Chatbot as that would increase maintenance.

Code Owners

See #project-xpert-platform via Slack for more info.

Places it's currently deployed

See src/client_configurations folder

Features included

  • Configurable ux, logos, disclaimer, privacy policy, prompts and chat api endpoint
  • Chatbot launch button
  • Proactive message to enage visitors
  • Chatbot popup screen for main conversation
  • Network error message if network or api is down
  • Mobile & desktop responsive design

Tech stack

This project was created with the following:

See package.json for more info.

To view component library demo and develop (entry point src/demo.jsx):

  1. Switch the the correct version of node (install nvm if necessary):
nvm use
  1. Install dependencies:
npm i
  1. Start app:
npm start
  1. Go to http://localhost:5173/
  2. Verify all chatbot ux and functionality work as expected since changes can affect them all
  3. Write automated tests to avoid too much manual verification and to make sure existing functionality isn't broken.

<add picture here> <add video here>

To verify components within /dist folder via script tag:

  1. Install serve
npm i -g serve
  1. Build && Serve /dist folder
npm run build && serve -s dist
  1. Configure chatbot by providing window.XpertChatbotFrontend.xpertKey or window.XpertChatbotFrontend.configurations within dist/index.html. Client configurations are located in src/client_configurations.
  2. Go to http://localhost:3000/ and verify chatbot works as expected.
  3. Segment.io window.analytics.track function must also be loaded globally for chatbot to appear.
  4. If the chatbot is hidden by a test cookie, perform the following:
  • Right click page and select Inspect
  • Select Console tab
  • Replace following xpert-key placeholder with xpertKey found in src/client_configurations
  • Execute: document.cookie = "xpert-key-test=1; expires=Thu, 23 Dec 2025 12:00:00 UTC; path=/";
  • Refresh the page
  1. Verify in dist folder, js file size is below 400kb and css is below 50 kb uncompressed.
  2. These verifications are essential to making sure it integrates with external clients ie Wordpress

To run linter:

npm run lint

To run tests:

npm test

Deployment

We deploy an NPM package to npmjs.org with the name @2uinc/frontend-component-xpert-chatbot To install the package, run the following command:

$ npm install @2uinc/frontend-component-xpert-chatbot

Also add to page head element:

<link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />

For clients that don't have React, there's the option to pull the resources from CDN.

CDN

A CDN deployment occurs after the NPM deployment for clients that don't have React. See publishCmd in package.json.

<head>
  <link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />

</head>
<body>
  <script defer src="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.js"></script>
</body>

Beta releases

To create a beta release for testing, 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:

@2uinc/frontend-component-xpert-chatbot@v{tag-name}

A CDN release will also be created and published to:

https://chatbot-frontend.prod.ai.2u.com/@{tag-name}/index.min.js
https://chatbot-frontend.prod.ai.2u.com/@{tag-name}/index.min.css
1.10.0

6 days ago

1.9.0

8 days ago

1.8.1

10 days ago

1.8.0

13 days ago

1.7.1

14 days ago

1.7.1-beta.1

15 days ago

1.7.0

27 days ago

1.7.0-beta.3

30 days ago

1.7.0-beta.4

30 days ago

1.7.0-beta.2

30 days ago

1.7.0-beta.7

29 days ago

1.7.0-beta.8

29 days ago

1.7.0-beta.5

29 days ago

1.7.0-beta.6

29 days ago

1.7.0-alpha.1

29 days ago

1.6.7

1 month ago

1.6.6

1 month ago

1.6.4

1 month ago

1.6.5

1 month ago

1.6.3

1 month ago

1.6.2

1 month ago

1.6.1

1 month ago

1.7.0-beta.1

1 month ago

1.6.0

2 months ago

2.0.0-alpha.1

2 months ago

1.5.0

2 months ago

1.3.27-alpha.3

2 months ago

1.3.27-alpha.2

2 months ago

1.3.27-alpha.4

2 months ago

1.4.0

2 months ago

1.3.27

2 months ago

1.3.27-alpha.1

2 months ago

1.3.26

2 months ago

1.3.25-beta.1

2 months ago

1.3.25

2 months ago

1.3.24

2 months ago

1.3.23

3 months ago

1.3.22

3 months ago

1.3.22-beta.1

3 months ago

1.3.20

3 months ago

1.3.21

3 months ago

1.3.16-beta.2

3 months ago

1.3.18

3 months ago

1.3.19

3 months ago

1.3.20-alpha.1

3 months ago

1.3.20-beta.1

3 months ago

1.3.19-beta.1

3 months ago

1.3.17

3 months ago

1.3.18-alpha.1

3 months ago

1.3.17-alpha.1

3 months ago

1.3.16-beta.1

3 months ago

1.3.15

3 months ago

1.3.16

3 months ago

1.3.14

3 months ago

1.3.13

3 months ago

1.3.13-beta.2

3 months ago

1.3.12-beta.3

3 months ago

1.3.12-beta.2

3 months ago

1.3.12

3 months ago

1.3.13-beta.1

3 months ago

1.3.12-beta.1

3 months ago

1.3.11

3 months ago

1.3.11-alpha.1

3 months ago

1.3.11-beta.9

3 months ago

1.3.10

3 months ago

1.3.11-beta.3

3 months ago

1.3.11-beta.4

3 months ago

1.3.11-beta.1

3 months ago

1.3.11-beta.2

3 months ago

1.3.11-beta.7

3 months ago

1.3.11-beta.8

3 months ago

1.3.11-beta.5

3 months ago

1.3.11-beta.6

3 months ago

1.3.10-beta.3

3 months ago

1.3.10-beta.2

3 months ago

1.3.10-beta.1

3 months ago

1.3.9

3 months ago

1.3.8-beta.1

3 months ago

1.3.8

3 months ago

1.3.7

4 months ago

1.3.6

4 months ago

1.3.5

4 months ago

1.3.4

4 months ago

1.3.3

4 months ago

1.3.2

4 months ago

1.3.1

4 months ago

1.3.0

4 months ago

1.3.1-alpha.1

4 months ago

1.3.0-alpha.1

4 months ago

1.2.3-alpha.1

4 months ago

1.2.2

4 months ago

1.2.1-alpha.2

4 months ago

1.3.0-beta.4

4 months ago

1.3.0-beta.5

4 months ago

1.3.0-beta.6

4 months ago

1.3.0-beta.3

4 months ago

1.2.1

4 months ago

1.2.1-alpha.1

4 months ago

1.3.0-beta.2

4 months ago

1.3.0-beta.1

4 months ago

1.2.0-beta.15

4 months ago

1.2.0

5 months ago

1.2.0-beta.14

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.2.0-beta.13

5 months ago

1.2.0-beta.12

5 months ago

1.2.0-beta.11

5 months ago

1.2.0-beta.10

5 months ago

1.2.0-beta.9

5 months ago

1.2.0-beta.8

5 months ago

1.1.2

5 months ago

1.2.0-beta.7

5 months ago

1.2.0-beta.5

5 months ago

1.2.0-beta.4

5 months ago

1.2.0-beta.6

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.2.0-beta.1

5 months ago

1.2.0-beta.3

5 months ago

1.2.0-beta.2

5 months ago

1.0.5

6 months ago