DEVELOPER WIDGETS

Country decision block

Return an allow, block or unknown decision and use your callback to control your own HTML.

Working controls. Ready to try. Examples on orig.ooo share one IP-country lookup. Language and country decision elements return data and callbacks; their output panels below are demonstration UI. Connecting to the lookup service… CDN URLs & setup instructions →

Where this fits

  • Show or hide a regional offer
  • Display country-specific availability
  • Choose a regional application message

Read the full integration reference → · All widgets

TRY IT. READ THE CODE.

Try the widget. Copy its code.

05

Country decision block

Return an allow, block or unknown result to your own JavaScript. Use the callback to show a regional message, hide an offer or trigger your application logic.

LIVE EXAMPLE

Regional offers · Availability messages · Conditional HTML

Decision outputWaiting for country

These buttons simulate a country for this example.

The element itself is invisible. The HTML preview is controlled by its result. Enforce protected-content access on your server.

HTML
<script type="module" src="https://orig.ooo/cdn/widgets/1.4.7/widgets.js"></script>

<origooo-country-blocker id="region-rule"
  auto-detect key="og_pub_2b113c8b0d21011497e7db566da928dd4c23d4404b4bbc5e"
  endpoint="https://orig.ooo/v1/ip/me"
  blocked-countries="US,GB" unknown-policy="unknown">
</origooo-country-blocker>
<div id="regional-offer" hidden>Your regional offer</div>
<script>
  const rule = document.querySelector("#region-rule");
  let countryDecision;
  rule.onResolve = result => {
    countryDecision = result.decision;
    document.querySelector("#regional-offer").hidden =
      result.decision !== "allow";
    // Or call your own function with result.
  };
  // rule.result, rule.dataset.decision and
  // rule.dataset.allowed expose the same output.
  // Event alternative: addEventListener("decision", handler).
</script>

Load the module once. The hosted module loads its dependencies automatically. Self-host the complete kit.

AUTOMATIC IP DETECTION

Detected from your actual IP.

Request an approximate country from an active dataset. Existing manual choices stay in place. On orig.ooo this uses one lookup through the site’s origin-restricted publishable widget key.

No IP request made.

Estimated countryNot checked

Country and language suggestions are approximate. Saved visitor preferences take priority.

Use the decision in your application

This element returns data. Your own JavaScript controls the visible interface. Subscribe to onResolve, listen for events or read result and data attributes.

const element = document.getElementById("region-rule");
let decisionResult;
element.onResolve = result => {
  decisionResult = result;
  // Update your own HTML or call your application function.
};
// element.result and element.dataset expose the output too.

Complete attribute, event and callback reference →

YOUR NEXT BUILD STARTS HERE

Get your free API key.

1,000 monthly credits. No credit card required.

Account services are not connected in this preview. Explore the dashboard or download the implementation from your workspace.
Read the integration guide

Production accounts require verified email. Google OAuth and Paddle need deployment credentials.