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-configonce on boot, caches the resolved rules, and decides client-side. Cheapest on the server. - Per-request check — Storefront calls
/geo-block/checkon entry, gets a fresh decision per visitor (with a licence, also logged to the audit table). Use when you want stats.
Install
Or by hand:
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
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)
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.
| Group | Presets |
|---|---|
| Everywhere | WORLDWIDE |
| Geography | UK_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 blocs | EU, EEA, EFTA, GCC, ASEAN |
| Political / economic | SCHENGEN, G7, G20, BRICS, OECD, NATO, FIVE_EYES |
| Language / cultural | DACH, ENGLISH_SPEAKING, COMMONWEALTH |
Fetch the live catalogue (with country counts + descriptions):
Storefront integration
Polling site-config (cheap)
Per-request check (with logging)
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
| Method | Path | Description |
|---|---|---|
| GET | /geo-block/site-config | Public: resolved channel rules (cached client-side) |
| GET | /geo-block/check | Public: per-request decision (logged to the audit table with a licence) |
| GET | /geo-block/presets | Public: 37-preset catalogue |
| GET | /geo-block/admin/channels | Admin: list channels + rules |
| POST | /geo-block/admin/save | Admin: save a channel's rules |
| GET | /geo-block/admin/stats | Admin: block totals + top countries (licensed) |
| POST | /geo-block/admin/simulate | Admin: dry-run a visitor (licensed) |
| POST | /geo-block/admin/gc | Admin: 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.