This guide is a work in progress. If you have any questions, please reach out.

The Javascript front end SDKs

The JavaScript front end SDKs are available at https://www.npmjs.com/package/@prelude.so/js-sdk and they provide different features.

In this guide we focus on integrating the signals SDK to augment the verification process so that it includes extra browser information.

Using the front end JS Signals SDK

Backend integration overview

When you integrate any of the Prelude backend SDKs (available for Node.js, Go, Python or Kotlin/Java) to perform user verification, you will usually follow the Quickstart guide for the platform you are working with.

Regardless of the platform the basic steps to follow are:

  1. Install the backend SDK for your platform.
  2. Create a new instance of the SDK with your API key.
  3. Request the user to input their phone number and send it to your backend. Use the phone number to create a verification request with the SDK.
  4. Redirect the user to a check page where the user will input the verification code received.
  5. When the user submits the verification code to your backend, you forward it to Prelude using the SDK to check if it is the correct code. Then you will redirect the user to the appropriate page depending on the result.

Front end JS Signals SDK integration

With the JS Signals SDK you can augment the verification process to include additional browser information which can be used to combat fraud.

The process is quite simple. During step 3 above, your application will use the JS Signals SDK to gather browser signals and report them to your Prelude account.

Then, when your application submits the phone number to your backend, it will also include a dispatchId value (just a string value) that the JS Signals SDK will provide after gathering the browser signals.

The SDK is provided as an npm package and can be installed using the following command:

npm install @prelude.so/js-sdk

Once installed, use your favorite bundler to distribute it with your web app.

In general, you will simply need to instantiate the JS Signals SDK with your SDK key (that you can find in your Prelude dashboard) and call the dispatchSignals function in the same page that you already have to capture the phone number.

import { dispatchSignals } from "@prelude.so/js-sdk/signals";

await const dispatchId = dispatchSignals(<your-prelude-sdk-key>);

Finally, when you create the verification in your backend, besides the phone number you can now also pass this dispatchId value in all of the backend SDKs. Refer to the Quickstart guide for your platform of choice to see how to include it.