Utilities
Utility functions for Payload CMS to handle validation, ID extraction, and document resolution.
Installation
pnpm add payload-utilities About
Payload Utilities provides a collection of functions designed specifically to enhance the Payload CMS development experience. It includes utilities for creating type-safe validators, which allow you to combine custom validation logic with default validators. Users can implement complex validation scenarios while maintaining type safety throughout their code. Additionally, the plugin includes functions to extract IDs from various input types. This feature simplifies the process of working with Payload documents that may either be presented as raw IDs or as objects containing IDs. The extractId and extractIds functions streamline this process for developers. The getDocument and getDocuments functions efficiently resolve documents from either full objects or their IDs, providing a callback mechanism to fetch documents from a specified collection. This makes it easy to work with documents in a flexible manner, handling both full documents and references seamlessly.
Package info
- Package name
payload-utilities- Latest version
1.1.1- Unpacked size
- 9 kB
- License
- MIT
- Weekly downloads
- 3
- Last publish
- Mar 19, 2026
More from bhofstaetter
View profileSimilar plugins
More in DevtoolsOpenAPI
Autogenerate an OpenAPI specification from a Payload CMS instance and render it with Swagger UI, Redoc, RapiDoc, or Scalar.
Puck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Create Ideal CMS
Interactive CLI that scaffolds a production-ready Payload CMS monorepo preconfigured with FocusReactive plugins.
Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.