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.

All seven packages are tagged v0.1.0 and importable today via go get github.com/plinth-dev/sdk-go/<pkg>@v0.1.0.

PackageStatusResponsibility
authzv0.1.0Cerbos PDP client wrapper with explicit Decision and fail-closed semantics.
errorsv0.1.0Typed error vocabulary; sentinel errors via errors.Is; RFC 7807 mapping.
auditv0.1.0Emit CloudEvents-shaped audit events to a pluggable transport (NATS by default). Non-blocking.
healthv0.1.0Dependency probe registry with parallel execution and per-dep status JSON.
otelv0.1.0OpenTelemetry SDK initialisation with standard resource attributes.
paginatev0.1.0Cursor + offset pagination types and parsers; allow-list-based sort safety.
vaultv0.1.0Secret reader: /run/secrets/<name> first, env var fallback, in-memory cache.

All seven packages are published to npm at 0.1.0 and installable via pnpm add @plinth-dev/<pkg>.

PackageStatusResponsibility
authz0.1.0 on npmServer-only Cerbos gRPC wrapper; mirrors the Go SDK semantics.
authz-react0.1.0 on npmReact <PermissionsProvider> + usePermissions() + <Can>; batched-check-at-layout pattern.
api-client0.1.0 on npmTyped server-only fetch wrapper; never throws on HTTP errors; retries on 5xx/429.
forms0.1.0 on npmServer-action forms with Zod validation; <FormWrapper> + <FormField>.
tables0.1.0 on npmHeadless data tables with URL state via nuqs.
otel-web0.1.0 on npmBrowser OpenTelemetry SDK init with auto-instrumentations.
env0.1.0 on npmZod-schema-validated env vars; fail-fast at module load.

The four most load-bearing packages — read these first if you only read four:

API contracts are frozen for the 0.x line; breaking changes batch into 0.2.0. See the v0.1.0 launch for a full ship list.