Hulo Global home
For Vendure Vendure edition: for Vendure 3.5+ shops, installed with npm. Also available for WordPress: Geo-block for WordPress
For Vendure

Geo-block for Vendure: user manual

Overview

Geo-block gives you per-channel control over who can reach your Vendure storefront. Add countries or pick a region preset, allow specific IPv4 and IPv6 addresses and ranges to bypass all rules, set business hours and maintenance windows, and, if you switch it on, have Vendure itself refuse purchases from blocked visitors. The free tier enforces all of that with five presets; a licence adds all 37 presets, subdivisions, soft-blocking of markets you don't ship to (so they can still browse), the audit log and stats, and the simulator (see Free and licensed).

Two storefront integration modes:

  • Site-config polling — Storefront calls /geo-block/site-config once on boot, caches the resolved rules, and decides client-side. Cheapest on the server.
  • Per-request check — Storefront calls /geo-block/check on entry, gets a fresh decision per visitor (with a licence, also logged to the audit table). Use when you want stats.

Install

curl -sSL https://huloglobal.com/vendure-plugins/geo-block/install.sh | bash

Or by hand:

# 1. Install yarn add @huloglobal/vendure-plugin-geo-block # 2. Register in vendure-config.ts import { GeoBlockPlugin } from '@huloglobal/vendure-plugin-geo-block'; export const config: VendureConfig = { plugins: [ GeoBlockPlugin.init({ publicBaseUrl: 'https://shop.example.com', licenceKey: process.env.HULO_LICENCE_KEY_GEO_BLOCK, // Optional: a one-shot maintenance lockdown window maintenanceWindow: { startsAt: '2026-07-15T02:00:00Z', endsAt: '2026-07-15T04:00:00Z', allowedIps: ['203.0.113.0/24'], }, }), ], }; # 3. Migration yarn migration:generate AddGeoBlockTables yarn migration:run
Upgrading to 0.15: 0.15 adds two Channel custom fields (geoBlockMaintenance, geoBlockEnforcePurchases). With synchronize: true nothing is needed; otherwise generate a migration as usual, or add the GeoBlockChannelFields1763020800000 migration the package ships. Until the columns exist, channel queries fail. Purchase enforcement stays off on every existing channel.

Admin UI tour

The Site Access page is mounted at /admin/extensions/geo-block (Settings → Geo Block). Tabs: Rules (including the purchase-enforcement switch), Block page, IP allowlist, Business hours, Maintenance, Simulate, Stats and Settings.

Rules

Site access — Rules tab Admin panel mockup. Channel: Elite [GEO-BLOCK ON] [Full block] — Mode — Full block (selected) / Soft block (browse-only) — Strategy — Allow specific places (selected) / Worldwide except blocked — Allowed regions (3 picked) — UK only ✓ / British Isles ✓ / EU / EEA / EFTA / Schengen / Nordic / DACH — G7 / G20 / NATO / OECD / Commonwealth / English-speaking / … — UK subdivisions — England ✓ / Wales ✓ / Scotland / Northern Ireland Vendure Admin Site access — Rules tab Channel: Elite [GEO-BLOCK ON] [Full block] ModeFull block (selected) Soft block (browse-only) StrategyAllow specific places (selected) Worldwide except blocked Allowed regions (3 picked)UK only ✓ British Isles ✓ EU EEA EFTA Schengen Nordic DACHG7 G20 NATO OECD Commonwealth English-speaking … UK subdivisionsEngland ✓ Wales ✓ Scotland Northern Ireland
Rules tab — pick mode, strategy, regions, sub-regions. Live preview shows resolved country list at the bottom. Soft block, the 32 extra presets and sub-regions need a licence.

Block page

Customise the block page per channel: a free-text message, optional redirect URL (when set, blocked visitors are 302'd there instead), optional logo URL.

IP allowlist

Add specific IPs or IPv4 and IPv6 CIDR ranges (203.0.113.0/24, 2001:db8::/48) that bypass every rule. Use for your office, oncall engineers, payment processor probes, monitoring. Add my IP adds the address the server sees for you.

Business hours and Maintenance

Opening hours per channel (days, opening and closing time, time zone; overnight ranges work) and what happens outside them, and per-channel maintenance windows (at most 31 days, with extra IPs that get in and a message). The IP allowlist gets in; allowlisted crawlers bypass both for page views, so search engines keep the site indexed, but never for purchases.

Simulate (licensed)

Site access — Simulate tab Admin panel mockup. Test a hypothetical visitor — Input: Country code: US — Input: UK region (optional): — — Input: IP address (optional): 8.8.8.8 — [Run simulation] — Result — 🚫 Blocked (country-not-allowed) Vendure Admin Site access — Simulate tab Test a hypothetical visitor Country code: US UK region (optional): — IP address (optional): 8.8.8.8 [Run simulation] Result🚫 Blocked (country-not-allowed)
Simulate tab — try any country / IP combination without saving anything to production.

Stats (licensed)

Last N days of block decisions: total blocks, soft blocks, unique blocked IPs, top blocked countries, daily series, breakdown by reason.

Region presets

The plugin ships 37 hand-curated presets, grouped in the picker by kind. The free tier can add five of them (WORLDWIDE, UK_ONLY, EU, NORTH_AMERICA and OCEANIA); a licence adds the rest, and presets saved while licensed are kept.

GroupPresets
EverywhereWORLDWIDE
GeographyUK_ONLY, BRITISH_ISLES, UK_CROWN_DEPENDENCIES, EUROPE, NORDIC, BALTIC, BENELUX, IBERIA, BALKANS, NORTH_AMERICA, CENTRAL_AMERICA, CARIBBEAN, SOUTH_AMERICA, LATAM, OCEANIA, ANZ, MENA, APAC, EAST_ASIA, SOUTH_ASIA, AFRICA
Trade blocsEU, EEA, EFTA, GCC, ASEAN
Political / economicSCHENGEN, G7, G20, BRICS, OECD, NATO, FIVE_EYES
Language / culturalDACH, ENGLISH_SPEAKING, COMMONWEALTH

Fetch the live catalogue (with country counts + descriptions):

GET /geo-block/presets

Storefront integration

Polling site-config (cheap)

// On storefront boot, once per channel const res = await fetch('https://shop.example.com/geo-block/site-config', { headers: { 'vendure-token': CHANNEL_TOKEN }, }); const cfg = await res.json(); // Cache cfg.geoBlock for ~60s, decide client-side based on the visitor's country.

Per-request check (with logging)

// In your storefront middleware const res = await fetch('https://shop.example.com/geo-block/check', { headers: { 'vendure-token': CHANNEL_TOKEN, 'cf-ipcountry': req.headers['cf-ipcountry'], // proxy already resolved }, }); const verdict = await res.json(); if (!verdict.allowed) { if (verdict.redirectUrl) return res.redirect(302, verdict.redirectUrl); return res.render('blocked', { message: verdict.message, mode: verdict.mode }); }
In soft mode (licensed) the storefront should render the full site with a banner explaining you don't ship to the visitor's country. A soft block is a banner only: it does not hide or refuse the checkout; use a full block with purchase enforcement for that. The plugin returns mode: 'soft' on the verdict; on the free tier a soft block acts as a full block.

Purchase enforcement (opt-in)

The checks above only advise the storefront. Switch on Refuse purchases from blocked visitors (Rules tab, or the channel custom field geoBlockEnforcePurchases) and Vendure itself refuses addItemToOrder, quantity increases and the move to ArrangingPayment for a visitor the rules fully block. It is off by default and fails open: an unknown country, an Admin API call or any lookup error means "allow".

Status codes

The block page (/geo-block/blocked) answers 403 for a country refusal and 503 with Retry-After for business hours and maintenance, with X-Robots-Tag: noindex. /geo-block/check answers 200 with JSON; add ?status=1 to get the same 403 / 503 for a full block.

Free and licensed

Every new installation has every feature on for its first 14 days, with no card and no licence key. After that the plugin keeps running in its free tier for as long as you like; a licence keeps the licensed features on. If a licence lapses, the licensed features stop and nothing is deleted: settings and data are kept, and a key switches them back on.

Free tier

  • Rules enforced, with 5 presets (Worldwide, UK only, EU, North America, Oceania)
  • IPv4 and IPv6 allowlist, with Add my IP
  • Business hours and per-channel maintenance windows, set in the admin
  • Purchase enforcement: blocked visitors cannot buy (a hard block, opt-in)
  • Verified crawler allowlist (reverse DNS)
  • Country from a trusted CDN header or a local MaxMind file, with a country-source diagnostic
  • 403 and 503 status codes on the block page
  • The Settings tab

Licensed (and the first 14 days)

  • All 37 region presets
  • Subdivisions (US states, German Länder, UK countries and more)
  • Soft block: a banner only, the shop stays open
  • The audit log and stats
  • The "what-if" simulator
  • The weekly report and set-up checklist

Buy a monthly, annual (two months free) or lifetime licence from the plugin page, or click Subscribe (or Buy lifetime) on the licence banner of the plugin's admin page: checkout opens in a new tab and the key installs itself within a minute, renewals included. Already have a key? Paste it into the same banner (Activate), no redeploy, or set HULO_LICENCE_KEY_GEO_BLOCK; the environment key wins when both are present.

HTTP endpoints

MethodPathDescription
GET/geo-block/site-configPublic: resolved channel rules (cached client-side)
GET/geo-block/checkPublic: per-request decision (logged to the audit table with a licence)
GET/geo-block/presetsPublic: 37-preset catalogue
GET/geo-block/admin/channelsAdmin: list channels + rules
POST/geo-block/admin/saveAdmin: save a channel's rules
GET/geo-block/admin/statsAdmin: block totals + top countries (licensed)
POST/geo-block/admin/simulateAdmin: dry-run a visitor (licensed)
POST/geo-block/admin/gcAdmin: prune old audit rows

Troubleshooting

Every visitor is blocked but my rules look right

Check the Rules tab's "Resolved allow-list" preview at the bottom — it shows the exact list that would be applied on save. If the list says nothing is allowed, you've probably picked a preset and then blocked every country in it.

Cloudflare IP appears as the visitor IP

The plugin uses Express's req.ip, so set trustProxy on the Vendure host, and list only headers your edge sets (and strips from clients) in trustedIpHeaders, for example ['cf-connecting-ip'] behind Cloudflare. Country headers (CF-IPCountry, Akamai, Fastly) are believed only from a trusted proxy; without one, point maxmindDbPath at a MaxMind-format file on the server. The Settings tab shows where your own country came from.

Stats panel is empty

Stats need a licence, and are populated by the per-request /check endpoint, not by /site-config. If your storefront only polls site-config, no audit rows are written. Either switch to /check or call /check as well in your storefront middleware.