@breadai/auth-api-key
v0.1.1
Published
API-key auth for bread — verify incoming requests, sign outgoing ones.
Maintainers
Readme
@breadai/auth-api-key
API-key auth for bread — authStrategy() verifies an incoming request's key timing-safely,
signer() attaches a key to outgoing requests. Same options shape for both.
bun add @breadai/auth-api-key # or: npm i @breadai/auth-api-keyimport { authStrategy, signer } from '@breadai/auth-api-key'
const strategy = authStrategy({
scheme: 'Bearer', // omit for a raw x-api-key-style header
keys: [process.env.API_KEY!],
// or resolve from a credential provider instead of a static list:
// credentials: envProvider(), credentialName: 'API_KEY',
})Pass strategy to @breadai/server's authPlugin() to guard a running server.
Part of bread — an explicit-by-design framework for AI agents. Docs: auth · all docs.
License
MIT © Matteo Zambon
