SaaSquatch Help Center

squatch.js is the Referral SaaSquatch JavaScript SDK and a one-stop shop to integrate a referral program into your website or web app.

Squatch.js Version 2

The Version 2 of our Squatch.js JavaScript SDK is built using the latest JavaScript and web standards (including being fully HTML5 compliant).

The flexibility of the Squatch.js Version 2 Library enables a wide range of functionality, including being used as a tracking script, to display widgets on a webpage, generate unique referral links, and the ability to create referral connections automatically.

We recommend that all new implementations use Squatch.js Version 2 to take advantage of these amazing features.

Get started with our Squatch.js Version 2 Library using our easy-to-follow Quickstart Guide.

The Squatch.js Version 2 technical reference includes details about, and examples for, all the available methods.

Display Options

The Referrer and Referred User Widgets can be displayed embedded in a page, or as a popup which can be displayed automatically on page load†, or displayed with the help of a CTA†.

The Squatch.js V2 Library is extremely modular and has been designed to work in single page apps with support for displaying multiple instances of the widget on the same page.

Set Display Rules

When and where you display the widget can be configured from within the Referral SaaSquatch Admin Portal.

† Classic programs only.

Infrastructure Ready

We have built Squatch.js Version 2 to to make use of the Universal Module Definition (UMD) API for JavaScript modules. This allows us to provide compatibilty for the latest modules which run in the client, on the server, or elsewhere (ES6, CommonJS, SystemJS, and AMD, to name just a few).

Squatch.js Version 2 also provides support for being easily included into your platform using a wide range of build tools such as Browserify, Webpack, NPM, and Babel.

Squatch.js Version 1

Squatch.js Version 1 is an asynchronous tracking library which uses the global window._sqh queue for asynchronous API calls. Version 1 is limited to a single instance on a page.

Get started with our Squatch.js Version 1 Library using our easy-to-follow Quickstart Guide.

The Squatch.js Version 1 technical reference includes details about, and examples for, the available methods.

Please note: we recommend using Squatch.js V2 since it's more flexibile and supports more use cases.

Which version am I already using?

If you started using SaaSquatch before November 2016 you are using Version 1.

The following two examples should help you identify which version of Squatch.js you are using in your product:

Squatch.js Version 2 Example
squatch.init({ tenantAlias: 'test_bpinhag9yagag' }); squatch.api().usertUser({ id: '5678', accountId: 'abc', email: '', firstName: 'Bob' }); });
Squatch.js Version 1 Example
window._sqh = window._sqh | [];
  tenant_alias: 'test_bpinhag9yagag',
  user_id: '5678',
  account_id: 'abc',
  email: '',
  first_name: 'Bob'

Additional Resources

Learn more about How Referral Programs Work in our Success Center.

Our guides section also offers walkthroughs for setting up a successful referral program, including options for different business models and using a wide range of reward types.

If you have any questions please feel free to reach out to our support team who will be more than happy to help.