Technical FAQ
Questions from developers integrating Zarex.
Can I use the SDK in the browser?
No. The API key is a secret: the SDK is only used server-side (middleware, route handler, Server Action, server hook). With Next.js, never use a NEXT_PUBLIC_ variable for the key.
What counts as a decision?
Each call from the SDK to Zarex counts as one decision, whatever the number of rules evaluated (from 1 to 10).
Can I have different rules depending on the route?
Yes. Create one configuration per route or group of routes: one middleware per route with Express, one withZarex per route handler with Next.js. You can also replace the rules for a specific request with the rules field of call.
Does Zarex see my users' passwords?
The request body is sent by default since 0.2.0, so that the Shield can look for attacks in it: a login form's password goes through it. It is inspected in memory and never stored in the decision log. inspectBody: false stops sending it. See Security and privacy.
Why use a test key and a production key?
To separate your traffic: the key's environment shows on every decision in the decision log. A test key that leaks into a repository can be revoked without touching production.
What does "Error" mean in the decision log?
A rule could not be evaluated, for example an impossible bot DNS check. The request was allowed: Zarex never blocks on a doubt.
How long are decisions kept?
One year.
Does Zarex detect VPNs and Tor?
No. Zarex knows the country and network (ASN) of each address, which you can use in a filter, but it does not classify addresses as VPN, Tor or hosting.
Which frameworks are supported?
Next.js, Express, Fastify (and NestJS on Fastify), SvelteKit and Bun. For another Node.js environment, createZarex and protect allow a direct integration: see SDK options.