🔗 About squatch.js
- Track referrals and create referral connections automatically
- Display widgets on a web page
- Generate unique referral links
- Send event data to the SaaSquatch ecosystem
Version 2 of squatch.js is flexible and fully HTML4 compliant. This version of squatch.js uses the UMD (Universal Module Definition) API, allowing us to remain compatible with the latest modules running in the client, on the server or elsewhere (including ES6, CommonJS, SystemJS and AMD, among others). Squatch.js Version 2 also provides support for a wide range of build tools, including Browserify, Webpack, NPM and Babel.
🔗 Install squatch.js
To power your program with squatch.js, you can take one of the installation paths below.
🔗 (Recommended) Get personalized scripts from the Install page
To start using squatch.js in your implementation, we recommend following along with Settings > Install page in the SaaSquatch Admin Portal. The page contains instructions on configuring squatch.js for several key use cases and generates the code snippets you’ll need to use for installation.
🔗 Reference generic examples in our squatch.js Scripts doc
Our squatch.js Scripts doc has a list of the key squatch.js scripts you may need for your implementation. These are general scripts and will need to be replaced with tenant- and program-specific information to function as intended.
🔗 Install squatch.js through NPM
The SaaSquatch squatch.js library is available as a package that can be installed through NPM. Installing squatch.js in this way avoids having to reload the library again each time a page is loaded. Here’s how to do it:
- Install squatch.js through NPM using the following command:
$ npm install @saasquatch/squatch-js
- Add squatch.js to your app so that it’s available on every page. You can use one of the following methods where applicable:
import * as squatch from "@saasquatch/squatch-js";
var squatch = require("@saasquatch/squatch-js");
- Use squatch.js normally. Learn more about loading the squatch.js tracking script and widget in our squatch.js Scripts doc.
🔗 Learn more
- squatch.js Scripts: See general examples of the most important scripts you’ll need when implementing a SaaSquatch program.
- Advanced Use Cases: Go beyond the basic scripts and learn how to reference existing user data, render a widget without requiring user information, and more.
- Signed Requests: Learn how to require a JWT or an API key when sending data to SaaSquatch.
- Tracking Cookies: Learn more about squatch.js and first-party cookies.
- Issue Code List: Find details and troubleshooting steps about error codes you encounter.
- squatch.js Reference: Full list of methods available.