CORE MODULE

Deploy and Embed the JavaScript Widget

What you'll learn in this guide

You'll see what the widget does, why it's the quickest way to bring identity verification into your own site, and exactly how to drop it onto a page once it's ready to go.

Overview

The JavaScript widget is a ready-built interface that walks your members through the verification process from start to finish, right inside your own website. You don't have to design any of the verification screens yourself. The widget handles the flow, the prompts, and the results, so you can offer a complete verification experience with just a few lines of code.

Because it's loaded straight from your account, the widget stays up to date on its own and behaves the same way wherever you place it. It's mobile responsive out of the box, so it looks and works correctly on phones, tablets, and desktops with no extra effort from you.

And since it's added with a standard script tag, it slots into any website no matter what's running behind it, whether that's React, .NET, WordPress, or plain HTML. There's no special stack required.

Make it look like part of your site

The widget is designed to feel native, not bolted on. Every part of the interface can be styled with your own custom CSS, so you can match your brand colours, fonts, spacing, and layout exactly. From subtle tweaks to a full visual overhaul, the look and feel is yours to shape.

That's the balance the widget strikes: you stay in full control of the styling and where it sits on the page, while the verification logic underneath stays managed and maintained for you. Your members get a smooth, on-brand experience, and you get a verification flow you don't have to build or babysit.

Before you deploy

The embed code is set up for you
‍
The JavaScript used to embed the widget is generated during onboarding and configured to your organisation's specific requirements, so you won't be writing it from scratch. If you'd like to deploy the widget, get in touch with your System Administrator or your ChandlerCX Growth Team representative and they'll get you set up.


Embed the widget

Once you've got your configured script, adding the widget to a page comes down to three quick moves.

  1. Add an empty container element to your page where you want the widget to appear, and give it an id the widget can target, for example ChandlerVerify-container.
  2. Load the widget by adding the script tag that pulls the bundle in from your account.
  3. Call Setup() and pass in your account URL, your container, the verification ID, and the functions to run on a successful or failed result.

Here's how that looks all together:

<script src="https://{your-account}.chandlerverify.com.au/cdn/js/dist/ChandlerVerify.Main.v1.0.bundled.min.js"></script>
<script>
ChandlerVerify.Setup(
  'https://{your-account}.chandlerverify.com.au',   // URL to your account
  '#ChandlerVerify-container',                      // HTML container to embed the widget in
  '123-XXXXX-XXXXXX',                               // verification ID (JWT)
  successCallback,                                  // function/redirect to call on a successful result
  errorCallback);                                   // function/redirect to call on a failed result
</script>

‍

And here's what each value in Setup() is for:

Value What it's for
Account URL The web address of your account, for example 'https://{your-account}.chandlerverify.com.au'. Swap {your-account} for your organisation's subdomain.
Container The element on your page where the widget will render, written as a CSS selector, for example '#ChandlerVerify-container'. This is the empty container you added in step 1.
Verification ID The token that ties this session to a specific member and check, supplied as a JSON Web Token (JWT). You'll generate a fresh one for each verification.
successCallback The function or redirect that runs when verification is completed successfully, so you can send the member on to the next step.
errorCallback The function or redirect that runs when verification fails, so you can show a message or route the member somewhere helpful.

That's all it takes. Once the script runs, the widget renders inside your container and your members can complete verification without ever leaving your site, and your success and error handlers take it from there.

‍

Quick tip
‍
Before you go live, double-check you've replaced the placeholder values ({your-account} and the sample verification ID) with your real account details, and test the flow end to end on both desktop and mobile so you can see your success and error handlers firing.

‍