The WidgetApi class is a wrapper around the Widget Endpoints of the SaaSquatch REST API.

Hierarchy

  • WidgetApi

Constructors

  • Initialize a new WidgetApi instance.

    Parameters

    Returns WidgetApi

    Example

    Browser example

    var squatchApi = new squatch.WidgetApi({tenantAlias:'test_12b5bo1b25125'});
    

    Example

    Browserify/Webpack example

    var WidgetApi = require('@saasquatch/squatch-js').WidgetApi;
    var squatchApi = new WidgetApi({tenantAlias:'test_12b5bo1b25125'});

    Example

    Babel+Browserify/Webpack example

    import {WidgetApi} from '@saasquatch/squatch-js';
    let squatchApi = new WidgetApi({tenantAlias:'test_12b5bo1b25125'});

Properties

domain: string
npmCdn: string
referralCookie: (() => Promise<ReferralCookie>) = ...

Type declaration

    • (): Promise<ReferralCookie>
    • Looks up the referral code of the current user, if there is any.

      Returns Promise<ReferralCookie>

      code referral code if true.

tenantAlias: string

Methods

  • Requests widget template

    Parameters

    Returns Promise<any>

    template html if true.

  • Creates/upserts user, requests widget template.

    Parameters

    Returns Promise<any>

    string if true, with the widget template, jsOptions and user details.

Generated using TypeDoc