RevAddress Checkout Guard: Drop-In Address Risk Widget
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:
<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
- Detects fields — Finds street, city, state, and ZIP inputs by common
name,autocomplete, andidattributes - Validates in real time — Calls the RevAddress validation API on input change
- Shows inline feedback — Green (verified), yellow (missing unit), red (undeliverable or high risk)
- Scores risk — On Growth+ plans, displays Logistics Complexity Index and fraud risk signals
Configuration
| Attribute | Default | Description |
|---|---|---|
data-api-key | required | Your RevAddress API key (rv_live_...) |
data-target | body | CSS selector for the form container |
data-theme | light | light or dark theme |
data-position | below | Badge position: below or above the address fields |
data-api-base | Production URL | Override for staging/development |
Badge states
The widget shows one of four badge variants:
- Green —
Verified delivery address— DPV confirmed, low fraud risk - Yellow —
Unit/apt number neededorAddress flagged for review— partial match or moderate risk - Red —
Address not foundorHigh risk address— undeliverable or fraud score >= 0.6 - Gray —
Address 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:
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.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:
| Field | Selectors 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
<!-- 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
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:
{
"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).
| Plan | Address validation | Fraud risk + LCI |
|---|---|---|
| Free | 100/month | Not included |
| Starter ($29/mo) | 5,000/month | Not included |
| Growth ($79/mo) | 25,000/month | Included |
| Enterprise | Custom | Included + 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.