How to deploy on other websites.

<link rel="stylesheet" href="https://widget.saleshandouts.com/widget.css">
<script src="https://widget.saleshandouts.com/widget.js?version=<?php echo date("U"); ?>" type="text/javascript"></script>
<script>
    var widgetDiv = document.createElement("DIV");
    document.body.appendChild(widgetDiv);
    widgetDiv.id = "_widget";
    window.MyWidget("_widget", "bottom-right");
</script>

Supported widget positions:

bottom-right
bottom-left
top-right
top-left

How to add a new widget

In the DB widget has 3 components and we need to update them in this order.

  1. widgets Table (widget primary data) note the widget_id after creating a widget.
  2. url_components table - this maps different urls to their corresponding widgets via widget_id obtained in step1.
  3. In this step we add different fields the widget will use to collect data. This is done in table fields.
Url Rules

you can have either of the following url/url patterns.

Fields Rules

Currently limited to text type fields only (text, number, email)

Development

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

yarn build:widget

builds Js only and puts the compiled JS file into public_html folder.
this also supports lazy loading.