Skip to content

SDK design

The Plinth SDK is two language families that encode the platform contracts. Modules import instead of cp -r. Each package below is independently versioned, semver-tagged, and published to its native registry.

PackageResponsibility
auditEmit CloudEvents-shaped audit events to a pluggable transport (NATS by default).
authzCerbos PDP client wrapper with explicit Decision and fail-closed semantics.
errorsTyped error vocabulary; sentinel errors via errors.Is; RFC 7807 mapping.
healthDependency probe registry with parallel execution and per-dep status JSON.
otelOpenTelemetry SDK initialisation with standard resource attributes.
paginateCursor + offset pagination types and parsers; allow-list-based sort safety.
vaultSecret reader: /run/secrets/<name> first, env var fallback, in-memory cache.
PackageResponsibility
authz-reactReact <PermissionsProvider> + usePermissions() + <Can>; batched-check-at-layout pattern.
api-clientTyped server-only fetch wrapper; never throws on HTTP errors; retries on 5xx/429.
authzServer-only Cerbos gRPC wrapper; mirrors the Go SDK semantics.
otel-webBrowser OpenTelemetry SDK init with auto-instrumentations.
formsServer-action forms with Zod validation; <FormWrapper> + <FormField>.
tablesHeadless data tables with URL state via nuqs.
envZod-schema-validated env vars; fail-fast at module load.

Phase B in progress. Per-package design ADRs land here as the API surfaces are locked. See the roadmap.