Skip to content

Payload Schema

Canonical Payload and Zod fields

@nexload-sdk/payload-schema

v1.1.0 Stable Released

Canonical Payload field definitions with reusable Zod schemas.

Payload CMSNode.jsESM

@nexload-sdk/payload-schema 1.1.0 defines intrinsic validation and normalization once, compiles it to ordinary Payload fields, and exposes the same Zod schemas to application boundaries.

Use it for reusable data-field contracts. It does not create collections, infer CRUD schemas, model populated relationship documents, own access control or collection hooks, provide an editor, or replace Payload-generated persistence types.

  • scalar, relationship, upload, container, rich-text, and native field factories;
  • a closed entity facade for Payload compilation and schema derivation;
  • canonical normalization in Payload beforeValidate;
  • structured configuration errors and safe inspection metadata.

The facade and exposed definition containers are frozen. However, nested option objects supplied by the caller are not a guaranteed immutable snapshot before compilation. Treat all factory input as write-once and do not mutate it after defineEntity.

  1. Install Payload and Zod peers.
  2. Follow the quick start.
  3. Learn ownership, schema availability, and lifecycle in concepts.
  4. Use guides for defaults, relationships, native fields, and derivation.
  5. Consult API and troubleshooting.

See source, tests, and issues. These docs cover the current version only.