This guide is a work in progress. If you have any questions, please reach
out.
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:- Install the backend SDK for your platform.
- Create a new instance of the SDK with your API key.
- 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.
- Redirect the user to a check page where the user will input the verification code received.
- 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.
Frontend web SDK integration
With the web 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 web 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 adispatchId
value (just a string value) that the web SDK will provide after gathering the browser signals.
Installation
The SDK is provided as an npm package and can be installed using the following command:Configuration
@prelude.so/js-sdk
contains a web worker and .wasm
code. This means if you are developping a bundled web app, you'll need some setup steps to make it work. This section explains those steps for different bundlers.
How to use
In general, you will simply need to instantiate the web SDK with your SDK key and call thedispatchSignals
function in the same page that you already have to capture the phone number.
Important: When you generate the SDK key in the Prelude dashboard you will be able to copy it and you should store it somewhere secure, as the dashboard will not allow you to display the same key again.
dispatchId
value in all of the backend SDKs. Refer to the Quickstart guide for your platform of choice to see how to include it.