API Reference
Packages
| Package | Description |
|---|---|
| @opengovsg/logging | A framework-agnostic structured logging core built on pino. It standardises a flat, Datadog-aligned newline-delimited JSON wire schema with custom syslog levels, scoped loggers that accumulate an action path, contextual metadata, an oversized-context guard, and pluggable error serialisation (a framework-neutral default, overridable via ). Call once at boot with your deployment identity, then create request-scoped loggers from the returned . |
| @opengovsg/rate-limit | A framework-agnostic rate-limiting core built on rate-limiter-flexible. Counters live in an injected Redis ( guards pre-authentication traffic by client IP. enforces per-actor, per-resource quotas for identified traffic. exposes the underlying core for anything else. |
| @opengovsg/testcontainers | A declarative wrapper over testcontainers for integration and e2e test setups: a zod-validated container config schema, setup/teardown over GenericContainer, Vitest context handoff, and Postgres/Redis presets. |
| @opengovsg/validators | A set of validators that provide sensible defaults to prevent common security vulnerabilities. |