Skip to main content
Any Redop instance is a plugin, and the built-ins all compose through .use(...).

Example

import { analytics, apiKey, cache, logger, rateLimit, Redop } from "redop";

new Redop({ name: "plugin-demo", version: "0.1.0" })
  .use(logger({ level: "info" }))
  .use(analytics({ sink: "console" }))
  .use(apiKey({ secret: process.env.API_SECRET, headerName: "x-api-key" }))
  .use(rateLimit({ max: 60, window: "1m" }))
  .use(cache({ ttl: 30_000 }));

What each built-in is for

  • logger for structured tool lifecycle logging
  • analytics for timing and success/failure events
  • apiKey for x-api-key style auth
  • bearer for Authorization: Bearer ...
  • rateLimit for in-memory throttling
  • cache for in-memory response caching

Mental model

  • auth, rate limits, and caching are middleware-style concerns
  • logging and analytics are observability concerns
That split maps directly to how the built-ins are implemented.