Keyring

Test mode for your API.

Everything a public API needs between the key and the handler: test mode, keys, rate limits, idempotency and usage, as one middleware in your own process and one dashboard. Never a proxy in front of it.

MIT SDKs for Express, Fastify, NestJS and Next.js. EU-only control plane. Not on npm yet.

server.mjs
import { keyring } from '@keyring/express';

app.use(
  keyring({ resources: { orders: { live: liveOrders, test: testOrders } } }),
);

app.get('/v1/orders', (req, res) =>
  res.json({
    tenant: req.keyring?.tenantId,
    env: req.keyring?.env,
    orders: req.keyring?.orders,
  }),
);

A test key gets the test list, a live key gets the live list, and no key gets a 401. Executed against the real packages before every deploy of this site.

Two keys, one endpoint

Your customer gets a kr_test_ key and a kr_live_ key. Both hit the same route. The middleware verifies either from memory and hands your handler the resources for that environment. Test traffic is free and never counted toward billing.

kr_test_…

200

orders: the test list

kr_live_…

200

orders: the live list

no key

401

every denial looks the same

What ships today

When Keyring is down

Every node keeps verifying from its cache. What an unknown key does then is a decision you make per route, and the default admits one after 60 seconds of staleness so that an outage of ours is invisible to your customers. A money route sets closed. The full table, state by state, is written down rather than promised.

Read exactly what fails open

Not yet

  • The packages are not on npm. They install from tarballs you build.
  • There is no per-request explorer. Usage is per key per day and per tenant per month.
  • The edge runtime is refused, not degraded.
  • Python and Go SDKs are planned. The conformance fixtures they will pass exist today.

Built for

EU only, in EUR

The hosted control plane runs in the EU, with no US control plane, replica or failover. That is architectural, not a deployment option. The same recipe deploys on your own Coolify server as four resources on one Docker network.