Quickstart

Load the SDK, capture consent evidence on form submit, and verify it appears in the dashboard.

1. Add the SDK to your page

Add this script tag in your <head>. Replace YOUR_CID with the CID from your organization settings page in the dashboard.

html
<script
  src="https://sdk.expressconsent.com/sdk/v1/sdk.js"
  data-ec-cid="YOUR_CID"
></script>

2. Capture evidence on submit

Call captureCDR() inside your form submit handler, before page navigation. The returned cdrId is your evidence ID — store it with your lead/user record.

javascript
document.getElementById("consentForm")?.addEventListener("submit", async (e) => {
  e.preventDefault();

  try {
    const { cdrId } = await window.ExpressConsent.captureCDR({
      // Optional: metadata to make this CDR searchable later.
      custom: { phoneNumber: document.getElementById("phone")?.value ?? "" },
      // Optional: highlight the submit button in the visual record.
      highlightTarget: "submit-primary",
    });

    // ✅ Save this ID with your lead/user record.
    console.log("Evidence saved:", cdrId);
  } catch (err) {
    console.error("ExpressConsent capture failed:", err);
    // Decide your policy: log and continue, retry, or block submission.
    // Most teams choose to log the error and let the form submit proceed.
  }

  e.currentTarget.submit();
});

3. Verify in the dashboard

Run a test submission, then confirm the CDR appears:

  1. Sign in → select your organization → open your domain → go to CDRs
  2. Find your cdrId in the list
  3. Open it and confirm the visual record (screenshot) clearly shows consent UI + legal text

4. Quick fidelity check

Open the CDR and confirm the visual record shows:

  • The consent checkbox/control visibly selected
  • The full consent/TCPA disclaimer text (not truncated or hidden)
  • No ambiguity from responsive layouts collapsing legal text

Done

Your integration is working. Store cdrId with every lead/user record going forward.