Skip to Content
ZarexDocs

SDK changelog

The changes in each version of the @zarex/* packages, and how to update.

The seven @zarex/* packages are published together, with the same version number.

Update

npm install @zarex/next@latest

Replace @zarex/next with your framework's package.

Service changes (no SDK update needed)

These changes apply to every SDK, with nothing to install.

  • New: visitors coming through Tor or a VPN. Two optional categories in detectBot(): CATEGORY:TOR (Tor network exits) and CATEGORY:VPN (networks of known VPN providers). Nothing changes until you add them to deny. Many honest visitors use Tor or a VPN: start with DRY_RUN. See Visitors coming through Tor or a VPN.
  • More decisions per month: the Free plan now includes 80,000 accepted decisions per month. The technical ceiling, the only thing that stops analysis, is now 10 times your plan on Free and 20 times on paid plans (it used to be 20 times for every plan; the "Quota messages fixed" entry below predates this change). See Account and quota.
  • Webhooks recognized as bots: calls from Stripe, PayPal, Shopify, Zapier, SendGrid, Zendesk… are now recognized by detectBot(), and therefore denied by default. On the route that receives your webhooks, allow them with detectBot({ allow: ["CATEGORY:WEBHOOK"] }), or do not apply detectBot() there. Also verify each webhook's signature. See Bot detection.
  • Requests without a User-Agent: they are treated as a bot (EmptyUserAgent) and denied by default. If your mobile app or a partner calls your site without a User-Agent, allow it: allow: ["EmptyUserAgent"].
  • Disposable email addresses: disposable services are also recognized by their mail infrastructure. A brand-new disposable domain is denied from its very first address, even if it is not on any list yet.

0.3.2

  • The ipSource check in the dashboard. The SDK attaches a short code to its decisions (its conclusion, and the anomalies it spotted), never an address. The dashboard home page shows an alert when requests bypassed your proxy, and a suggestion when your setting looks wrong. No extra request, no decision change. ipDiagnostic: false also turns this off. See In the dashboard.

0.3.1

  • README updated on npm: the phoneValidation() description now matches the documentation (format, line type, country and carrier). No behavior change.

0.3.0

  • New: the ipSource check. After the first requests (at least 200), the SDK writes the most likely ipSource setting to your logs once, if yours looks wrong. It changes nothing (not the address, not the decision, not what is sent to Zarex), sends nothing and says nothing when everything is fine. To turn it off: ipDiagnostic: false. See The ipSource check.
  • Two new warnings with Express, Fastify and Bun: a request that bypasses your proxy while { proxies } or { header } trusted its header, and a { header } header your proxy does not overwrite. See What the SDK warns you about.
  • The "A proxy header … is present" message now suggests { trustedProxies: [...] } instead of { proxies: 1 }.
  • No decision or configuration change: new messages may appear in your logs.

0.2.8

  • Security fix, update strongly recommended if you use ipSource: { proxies }, { trustedProxies }, { cloudflareVia }, or { header } with a header that holds a list (for example x-forwarded-for). A visitor could send a very long X-Forwarded-For header: their address could then no longer be determined and their request went through without being checked by your rules. Zarex now reads this header from the end, only where your proxies write: its length no longer has any effect. No configuration change.

0.2.7

  • New setting ipSource: { cloudflareVia: [...] } for the "Cloudflare, then your nginx or Caddy" setup: Zarex checks that the request really went through Cloudflare, then reads the visitor's real address. Works with Caddy as shipped; nginx needs one line. See Cloudflare, then your proxy.
  • If you use { trustedProxies: [...CLOUDFLARE_RANGES, …] } behind Cloudflare and your own proxy: with Caddy or nginx left at their defaults, this setting let every request through without checking (the SDK wrote it to your logs: "Every address in the chain is a trusted proxy"). Switch to { cloudflareVia }.
  • No other behavior change.

0.2.6

  • Security fix, update recommended: the search for JWT tokens in sensitive data (sensitiveInfo, responseGuard, maskSensitive) could take several seconds on a crafted text, enough to block your Node.js server during that time. It now reads the text in a single pass: a few milliseconds, with exactly the same results. No configuration change.

0.2.5

  • Missing key explained: if key is empty at startup, the message points to the most common cause, a .env file that is not loaded, and how to fix it (Node.js: node --env-file=.env; SvelteKit 3: declare ZAREX_KEY in src/env.ts). See SvelteKit.
  • Updated READMEs on npm: reading the key with SvelteKit 3, description of detectBot(). No other behavior change.

0.2.4

  • Links to the documentation from npm: each package now points to its quickstart page on zarex.dev. No behavior change.

0.2.3

  • Built-in documentation fixed: the help your editor shows for timeoutMs no longer gives an outdated value. No behavior change.

0.2.2

  • Faster, especially for servers hosted in Africa: under Node.js, the SDK keeps its connection to Zarex open between requests, and opens it as soon as your application starts. Low-traffic sites no longer pay for opening a connection on every visit.
  • Fewer degraded decisions: when a connection must be opened (first call, or long inactivity), the SDK gives it more time. No configuration to change.

0.2.1

  • Faster on hostile texts: the sensitive data search (sensitiveInfo, responseGuard) took up to 3 seconds on a crafted 1 MB text, enough to block your Node.js server during that time. It now takes a few tens of milliseconds, with exactly the same results.
  • Next.js: the "call guard.finalize" reminder no longer shows at startup for those who already call it. It only appears if guard.finalize is never called while secureHeaders or responseGuard is configured, and it respects logger: false.

0.2.0

  • New: critical routes (failMode: "closed"). On a login or payment route, a request is denied (503) when Zarex cannot decide, instead of going through without inspection. The default does not change: other routes let traffic through. See Critical routes.
  • Behavior change: request bodies are inspected by default (inspectBody is now true). An injection hidden in a form or a JSON body is blocked with no configuration. The body is inspected in memory and never stored. To go back to the previous behavior: inspectBody: false. With Express, place the middleware after express.json(); with Fastify, register the hook as preHandler.
  • Quota messages fixed: the message your plan's monthly quota is used up is replaced. Beyond your plan, protection continues and a warning shows; only the technical ceiling (20 times your plan) stops inspection. See Account and quota.

0.1.5

  • Security fix (Next.js, SvelteKit, Bun, with inspectBody: true): the request body was not inspected if it exceeded 48 KB, if it was sent without Content-Length or if it was a multipart/form-data form. An attacker could hide an injection behind padding. Now, the beginning and the end of a large body are inspected (beyond 1 MB, only the beginning), and multipart forms are inspected field by field. Update if you use inspectBody.
  • A warning shows once in your logs if shield() is used without inspectBody: form bodies are then not inspected.

0.1.4

  • Security fix (Next.js, SvelteKit, Bun): an onDeny that did not return a Response (a forgotten return, for example) let through the request Zarex had just denied. Now, the default denial response is sent (403, or 429 for a limit) and a warning shows in your logs. Update if you use onDeny.
  • The SDK reports its real version number to the engine (it sent 0.1.0 whatever the version).

0.1.3

  • New: ipSource: { header: "x-real-ip" } reads the visitor's address from the header written by your own proxy (nginx, Caddy…). It is the solution for self-hosted Next.js, on a VPS or in Docker. See The visitor's IP address.
  • Clearer messages when the visitor's address cannot be found, with the fix to apply.
  • Documentation fixed: with Next.js, { proxies }, { trustedProxies } and "cloudflare" do not work (Next.js does not provide the connection address).

0.1.2

  • ipSource becomes optional on Vercel, Fly.io and Cloudflare Workers: the platform is detected automatically.
  • baseUrl becomes optional: the SDK uses the Zarex service by default.

0.1.1

  • Documentation for each package on npm.
  • MIT license.

License

The @zarex/* packages are published under the MIT license.

On this page