Implement User Verification

This guide demonstrates how to implement user verification end-to-end using a simply Node.js Express server.

User verification ensures that only authorized users can access your private roadmaps or widgets. Because this process involves sensitive credentials (your Shared Secret), the authentication token must be generated on your server, never in the browser.

This guide provides a complete, minimal working example using Node.js. You can use this to understand the flow before integrating it into your main application.

Prerequisites

Before running the example, ensure you have the following:

  1. Node.js installed (v18 or newer recommended).

  2. Your Released credentials (found in Settings → User Verification):

    • ACCOUNT_ID

    • SHARED_SECRET

  3. The Channel ID for the portal you want to embed Finding the Channel ID

    • CHANNEL_ID


1. Set up the project

Open your terminal and run the following commands to create a folder and install the necessary web server framework (express).

mkdir released-auth-demo
cd released-auth-demo
npm init -y
npm install express

2. Create the server file

Create a file named server.js and paste in the code below.

triangle-exclamation

Security Warning

3. Run the server

Start the application in your terminal:

Bash

4. Tunneling (Required for HTTPS)

Most browsers restrict embedded widgets or cookies when running on localhost. To test this properly, you need a public https URL. We recommend using a tool like ngrokarrow-up-right.

  1. Install ngrok (if you haven't already).

  2. Run the tunnel in a new terminal window:

    Bash

  3. Copy the Forwarding URL provided by ngrok (e.g., https://a1b2-c3d4.ngrok-free.dev).

  4. Important: Add this URL to your Allowed Domains in the Released dashboard if you have domain restrictions enabled.

  5. Open the URL in your browser to see your authenticated roadmap.

5. Whitelist the ngrok domain

Add the ngrok domain to your list of trusted domains for embedded content.

Troubleshooting

chevron-rightWidget not loading?hashtag

Check your browser console. If you see CORS errors, ensure your ngrok URL is added to the "Allowed Domains" list in your Released settings.

chevron-rightFetch is not defined?hashtag

If you are on an older version of Node.js (< v18), upgrade Node or install node-fetch.

chevron-right401 Unauthorized?hashtag
  • Double-check that your SHARED_SECRET was copied correctly and contains no extra spaces.

  • Check the html source and ensure the token property in the embed html element was successfully populated.

Last updated

Was this helpful?