Skip to content
All Posts
SDK

RevAddress Checkout Guard: Drop-In Address Risk Widget

· 4 min read · By RevAddress · SDK

RevAddress Checkout Guard validates shipping addresses in real time during checkout. One <script> tag. Zero dependencies. Works in any checkout — Shopify, WooCommerce, BigCommerce, or custom.

Installation

Drop this into your checkout page, before the closing </body> tag:

One-line installation
<script src="https://revaddress.com/sdk/revaddress-guard.js"
      data-api-key="rv_live_your_key_here"
      data-target="#shipping-address"></script>

The widget automatically finds address fields inside data-target, watches for input, and shows a validation badge after a 500ms debounce.

What it does

  1. Detects fields — Finds street, city, state, and ZIP inputs by common name, autocomplete, and id attributes
  2. Validates in real time — Calls the RevAddress validation API on input change
  3. Shows inline feedback — Green (verified), yellow (missing unit), red (undeliverable or high risk)
  4. Scores risk — On Growth+ plans, displays Logistics Complexity Index and fraud risk signals

Configuration

AttributeDefaultDescription
data-api-keyrequiredYour RevAddress API key (rv_live_...)
data-targetbodyCSS selector for the form container
data-themelightlight or dark theme
data-positionbelowBadge position: below or above the address fields
data-api-baseProduction URLOverride for staging/development

Badge states

The widget shows one of four badge variants:

  • GreenVerified delivery address — DPV confirmed, low fraud risk
  • YellowUnit/apt number needed or Address flagged for review — partial match or moderate risk
  • RedAddress not found or High risk address — undeliverable or fraud score >= 0.6
  • GrayAddress check complete — validation ran but no strong signal

On Growth+ plans, the badge also shows the Logistics Complexity Index (1-10), which measures last-mile delivery difficulty based on carrier route, geography, and property data.

JavaScript events

The widget dispatches Custom Events on document for programmatic integration:

Listen for validation results
document.addEventListener('revaddress:validated', (e) => {
const { validation, intelligence, result } = e.detail;
console.log('Badge variant:', result.variant);  // 'valid', 'warning', 'error', 'neutral'
console.log('LCI:', result.lci);                // 1-10 or null
});

document.addEventListener('revaddress:riskDetected', (e) => {
const { score, level, signals } = e.detail;
if (score >= 0.6) {
  // Block checkout or require manual review
  disableSubmitButton();
}
});

document.addEventListener('revaddress:error', (e) => {
console.error('Validation error:', e.detail.error);
});

You can also use window callbacks:

Window callback alternative
window.onRevAddressValidated = (detail) => {
console.log('Validation complete:', detail.result);
};

window.onRevAddressRiskDetected = (detail) => {
console.log('Risk score:', detail.score);
};

Field discovery

The widget looks for address fields using these selectors, in order:

FieldSelectors checked
Street[name="streetAddress"], [name="address1"], [name="address"], [autocomplete="address-line1"]
City[name="city"], [name="shipping_city"], [autocomplete="address-level2"]
State[name="state"], [name="province"], [autocomplete="address-level1"]
ZIP[name="ZIPCode"], [name="zip"], [name="postal_code"], [autocomplete="postal-code"]

For SPAs and dynamically rendered forms, the widget uses a MutationObserver to detect new fields added to the DOM.

Shopify example

Shopify checkout.liquid
<!-- Add before </body> in checkout.liquid or via Shopify Script Editor -->
<script src="https://revaddress.com/sdk/revaddress-guard.js"
      data-api-key="rv_live_your_key_here"
      data-target="[data-step='shipping_method'], [data-step='contact_information']"
      data-theme="light"></script>

WooCommerce example

WooCommerce functions.php
add_action('wp_enqueue_scripts', function() {
  if (is_checkout()) {
      wp_enqueue_script(
          'revaddress-guard',
          'https://revaddress.com/sdk/revaddress-guard.js',
          [],
          null,
          true
      );
      // Set attributes via wp_script_add_data or inline script
  }
});

Webhook integration

On Growth+ plans, high-risk addresses automatically fire a checkout.risk_detected webhook. Register an endpoint in your dashboard to receive real-time fraud alerts:

Webhook payload
{
"event": "checkout.risk_detected",
"fraud_risk_score": 0.75,
"fraud_risk_level": "high",
"risk_signals": [
  { "signal": "cmra_detected", "weight": 0.40, "detail": "Commercial mail receiving agency" }
],
"recommended_action": "review",
"timestamp": "2026-04-15T12:00:00Z"
}

Pricing

Checkout Guard uses the same API key and plan as your other RevAddress API calls. Each field validation counts as one API call (validate) plus one intelligence call (on Growth+ plans).

PlanAddress validationFraud risk + LCI
Free100/monthNot included
Starter ($29/mo)5,000/monthNot included
Growth ($79/mo)25,000/monthIncluded
EnterpriseCustomIncluded + webhooks

Get your API key and start validating checkout addresses in under a minute.

Keep the free proof wedge first

USPS v3 developer toolkit. Free tier for validation and rates. Flat monthly pricing.

Validation, ZIP+4, and rates are the free proof path. Labels, tracking, BYOK, and pickup stay protected until the workflow and proof gates are actually ready.