0.2.2 • Published 2 years ago

@onsetio/widget v0.2.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Official Onset SDK for Widget Embed

npm version Documentation

We recommend that you should always be loaded the Widget.js script directly from https://widget.onset.io/widget.js, rather than including it in a bundle or host yourself. If must bundle the Widget code into your application, you can use this package.

Installation and Usage

Simply install the package:

npm install --save @onsetio/widget
yarn add @onsetio/widget

Setup and usage of these SDKs always follows the same principle.

import Widget from '@onsetio/widget';

const widgetInstance = new Widget({
  page: '__PAGE_HOST__',
  // ...
});

Embed via CDN

<script>
  window.onsetWidgetSettings = {
    triggerText: "🔔 What's New",
    page: '__PAGE_HOST__',
    // ...
  };

  (function (e, t) {
    e.onsetWidget = {};
    e.onsetWidget.on = function () {
      (e.onsetWidget.$ = e.onsetWidget.$ || []).push(arguments);
    };
    var c = t.getElementsByTagName('script')[0],
      i = t.createElement('script');
    i.async = true;
    i.src = 'https://widget.onset.io/widget.js';
    c.parentNode.insertBefore(i, c);
  })(window, document);
</script>
0.2.1

2 years ago

0.2.0

2 years ago

0.2.2

2 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago