@zedtech/zedkit-payload-seo
Validate editor-entered title/description lengths
Friendly max-length validators and constants for SEO titles and descriptions.
At a glance
- Who: Payload developers who want editors warned before over-long titles ship.
- What: Friendly max-length validators and constants for SEO titles and descriptions.
- Use when: On every editor-entered SEO text field.
- Avoid when: For hard truncation at render time — use
resolveDescriptionfrom@zedtech/zedkit-seoinstead. - See also: Add a localized SEO tab to a Payload collection, Derive descriptions, slugs, and localized fields
Install
pnpm add @zedtech/zedkit-payload-seoLatest: 1.0.2 (via changesets).
Example
import {
SEO_TITLE_MAX,
SEO_VALIDATION_MESSAGES,
formatMaxLengthMessage,
resolveLocale,
maxLengthValidator,
type SeoValidationMessages,
} from "@zedtech/zedkit-payload-seo";
validate: maxLengthValidator(SEO_TITLE_MAX);
formatMaxLengthMessage(SEO_VALIDATION_MESSAGES.maxLength.en, 70, 80);
resolveLocale(req);Wraps: (none)
Add a localized SEO tab to a Payload collection
A drop-in SEO group field (meta, OG, robots, JSON-LD) with localization and length validation.
Lint Node and TypeScript libraries
Spread eslint + typescript-eslint recommended, ban raw try/catch (point callers at `tryCatch` / `tryCatchAsync`), and ban deep `../..` imports in favor of `#*`…