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
- Last publish
- Mar 19, 2026
More from bhofstaetter
View profileSimilar plugins
More in Devtoolspayload-cli
CLI for direct access to PayloadCMS data for AI agents and humans.
agent API guide
Generate a live API reference and query guide for Payload CMS.
Markdown documentation sync
Syncs Markdown documentation with Payload CMS using Git.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.
Puck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.