Initialize a new Widgets instance.
Browser example
var widgets = new squatch.Widgets({tenantAlias:'test_12b5bo1b25125'});
Browserify/Webpack example
var Widgets = require('@saasquatch/squatch-js').Widgets;
var widgets = new Widgets({tenantAlias:'test_12b5bo1b25125'});
Babel+Browserify/Webpack example
import {Widgets} from '@saasquatch/squatch-js';
let widgets = new Widgets({tenantAlias:'test_12b5bo1b25125'});
Instance of WidgetApi
SaaSquatch domain for API requests
"https://app.referralsaasquatch.com"
Hosted CDN for npm packages
"https://fast.ssqt.io/npm"
Tenant alias of SaaSquatch tenant
Autofills a referral code into an element when someone has been referred. Uses squatchReferralCookie behind the scenes.
Element class/id selector, or a callback function
This function calls the render method, and it renders the widget if it is successful. Otherwise it shows the "error" widget.
Config details
json object if true, with a Widget and user details
This function calls the upsertUser method, and it renders the widget if it is successful. Otherwise it shows the "error" widget.
Config details
json object if true, with a Widget and user details
Generated using TypeDoc
Widgets
is a factory for creating widgets. It's possible to build your own widgets using the WidgetApi but most people will prefer to use these easy methods.