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

One key page, everything about it

Usage per day, scopes, the rate limit it inherited, rotation with overlap and a revoke with an optional reason, on one page of the dashboard. Every screenshot on this site is the real dashboard, taken against a throwaway workspace.

A key page in the Keyring dashboard: usage chart, details and the edit form

What ships today

When Keyring is down

Every node keeps verifying from its cache, so an outage of ours is invisible to your customers. What an unknown key does then is a decision you make per route, and what the default admits depends on the state of the cache: a complete cache admits nothing until it is stale past the budget, and a process that has never loaded a snapshot admits any well-formed key until its first successful poll. 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 three resources on one Docker network, plus this docs site, which joins none.