1.1.21 • Published 29 days ago

yelda-webchat v1.1.21

Weekly downloads
77
License
MIT
Repository
github
Last release
29 days ago

Yelda Website Chat Plugin

Introduction

Yelda Website Chat Plugin is a library that enables your website to load yelda.ai webchat in an iframe integrated into your website

Demo

Usage - From Yelda website

Each time a new package version is published, we also update static minified version on Yelda.

<script
  type="text/javascript"
  src="https://yelda-webchat.s3.eu-west-3.amazonaws.com/js/yeldaWebchatInjector.min.js"
></script>

<script>
  yeldaChat.init({settingId: xxxx}) // settingId available on your Yelda Platform > Webchat page
</script>

Usage - From Node Packages Manager

System requirements Node.JS 8+

Install & setup

  • Install with npm
 npm install yelda-webchat --save
  • Import yeldaChat js lib and yeldaWebchatInjector.min.css OR load js using script and link tags

Or use import instruction

import yeldaChat from "yelda-webchat";
import "yelda-webchat/dist/css/yeldaWebchatInjector.min.css";

Or add the <script> in the <body>, and the <link> in the <head> tags

<link
  rel="stylesheet"
  type="text/css"
  href="/node_modules/yelda/dist/css/yeldaWebchatInjector.min.css"
/>
<script
  type="text/javascript"
  src="/node_modules/yelda/dist/js/yeldaWebchatInjector.min.js"
></script>

<script>
  yeldaChat.init({settingId: xxxx}) // settingId available on your Yelda Platform > Webchat page
</script>

if you don't provide the css, the latest yelda version will be automatically loaded asynchroneously by the library

Usage - downloaded

We don't advise you to download a local version without using the NPM package : you might miss an important update.


Expert custom initialization without settingId

Initialize the lib with the Yelda provided elements

NameTypeDefaultDescription
assistantSlugStringThe assistant short name on Yelda Required
assistantIdStringThe assistant id on Yelda Required
assistantUrlStringhttps://app.yelda.ai
chatPathString/chat
localeStringfr_FR
isAdminBooleanfalseSet to true only to access the conversations analysis
shouldBeOpenedBooleanfalseSet to true to open the chat popin on load. With default false value, the webchat is closed and the user only see the assistant image or the start button
parentContainerIdStringDOM element id where you want to add the iframe. If the 'container_id' does not exist in the DOM, the iframe will be automatically inserted into the document body
bubbleContainerChildIdStringChild DOM element id where you want to add bubble element. If the 'bubbleContainerChildId' does not exist, the chat won't be loaded
isStartBtnBooleanfalseSet to true only if need to show 'start' button. ⚠️ This is an admin feature. It can only work if isAdmin is also set to true
canBeClosedBooleantrueIt is used to toggle the visible state of close button. ⚠️ If parentContainerId is provided and canBeClosed is not provided, canBeClosed is set to false
isDemoBooleanfalseSet to true to flag the conversation as "demo" in conversations list and training inbox and force the webchat to be opened on page load, even if shouldBeOpened is set to false
yparamStringnullIf the iframe's parent URL contains "yparam" parameter, then yparam value will be passed as the settings. yparam value "yshowbot" will force the webchat to be opened on page load, even if shouldBeOpened is set to false
envStringForce an env value. It is used to get the webchat settings from Redis.
yeldaChat.init({
  assistantSlug: "<assistantSlug>",
  assistantId: "<assistantId>",
  assistantUrl: "<assistantUrl>",
  chatPath: "<chatPath>",
  locale: "<locale>",
  isAdmin: true | false, // Used to see the NLP logs
  isStartBtn: true | false, // Used to show the start button on chat load
  shouldBeOpened: true | false, // open the chat window by default on loading the page if set to true
  parentContainerId: "chat_frame",
  canBeClosed: true | false,
  isDemo: true | false, // Only useful if the webchat is on a demo page
});

To avoid issue with window.onload which might not be called when using JS Frameworks, you can also use yeldaChat.setupChat(data), and even reset it with yeldaChat.reset(data)

Issues and Feature Requests

If you have a bug report, feature request, or wish to contribute code, please open an issue.

When submitting a bug report, please include the following information :

  • Which install setup your are using : npm install or script tags
  • Which OS and browser version your are using, e.g. Ubuntu 18.04 with Firefox Quantum 63.0.3
  • A minimum reproducible test case, i.e. a short snippet that demonstrates the bug, if applicable

Run it in local

Build it

npm run build

and then open test/index.html in a browser

Version update & upload to S3 command

Run this command to build, test, increment the npm version, publish the package, upload to s3 bucket & finally copy the content of dest folder to Yelda repo if the yelda static folder path passed as argument. Default value for semver is patch

It requires AWS creds, bucket & region information in .env to upload the build files to s3 bucket and npm version command requires git working directory to be clean otherwise it throws error

you'll also need to provide an otp (one time password for NPM 2 factor authentication)

npm run uploadBuildToS3 --semver=patch --destinationPath=/home/Documents/www/yelda/git/yelda/frontend/static -o 1111111

License

The MIT License (MIT)

Copyright (c) 2018-2019 Yelda dobby@yelda.ai

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.1.21

29 days ago

1.1.19

1 month ago

1.1.20

1 month ago

1.1.18

1 month ago

1.1.17

1 month ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.13

2 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago