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
- 19
- Last publish
- Mar 19, 2026
More from bhofstaetter
View profileRBAC
Adds role-based access control to your Payload CMS.
Query
Type-safe query filters and field selection for Payload, with a REST select parameter plugin.
create api docs
Generate OpenAPI 3 documentation for Payload CMS.
Swagger
Swagger plugin for Payload CMS that generates OpenAPI documentation.
OpenAPI
Generate OpenAPI 3 documentation for Payload CMS endpoints.