react-webintegration-template
react-webintegration-template
is an injectable React Application that serves a conversational chat-widget.
Installation
react-webintegration-template
requires Node.js v14+ to run.
Install the dependencies by running these commands.
git clone git@gitlab.com:GreenhouseGroup/gh-teams/conversational/react-webintegration-template.git
cd react-webintegration-template
yarn
Usage
For development environments
yarn start
Running a build for production
yarn build
# optional command to publish the packge to npm/jsdelivr
yarn publish
Deploy the latest version to NPM & jsDelivr.
yarn deploy
Add browser-sync to test the inject script locally, then run the following command. Note: You can adjust the uuid inside example/index.html on line 394.
yarn example
Or inject the script using a browser extension using the following code.
(function () {
window.conversational = { id: 'c655906f-fb6e-4879-bc63-ba4184f5de54' };
var r = document.createElement('div'); r.id = 'ghg__conv-wit'; document.body.appendChild(r);
var e = document.createElement('script'); e.async = true; e.src = 'https://cdn.jsdelivr.net/npm/@freshfruitdigital/conv-inject-react-app@latest/build/main.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
})();
Packages
react-webintegration-template
is currently extended with the following packages.
Instructions on how to use them in your own application are linked below.
Package | Documentation |
---|---|
craco | npmjs.com |
gsap | npmjs.com |
styled-components | npmjs.com |
swr | npmjs.com |
react-device-detect | npmjs.com |
react-helmet-async | npmjs.com |
react-conversational-chatcomponent | gitlab.com |
License
MIT / Jim de Ronde / 2021
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.