Getting Started

The JavaScript Web API allows you to interact with Prefinery using JavaScript. You can add new users, trigger referrals & rewards, and display embeddable widgets.

Step 1: Install the Prefinery JavaScript Snippet

The first step is to install the Prefinery JavaScript Snippet on your website, which can be done by following these steps:

1. Go to your project and click on the Installation link and copy your project's unique JavaScript Snippet.

2. Add the JavaScript Snippet into the <head> section of your website so that it loads on each webpage.

When you install the Snippet, your pages get access to the global window.prefinery object, which you will use to make calls to the API.

Note: The Prefinery JavaScript Snippet has changed slightly. If you copied & pasted the snippet into your website before January 17, 2021 you should perform the installation instructions again, copying the up-to-date snippet and re-installing on your website.

Next, check out the tutorials.