npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

payload-user-generated-fields-plugin

v0.1.19

Published

A plugin for Payload CMS v3 that allows admin users to create custom fields for collections.

Downloads

163

Readme

Payload User Generated Fields Plugin

A Payload CMS plugin that lets admins define dynamic field configurations in one collection and capture user-entered values in another.

Install

bun add payload-user-generated-fields-plugin

Usage

Add the plugin to your payload.config.ts:

import { buildConfig } from 'payload'
import { pluginUserGeneratedFields } from 'payload-user-generated-fields-plugin'

export default buildConfig({
  collections: [
    {
      slug: 'post-categories',
      fields: [{ name: 'title', type: 'text' }],
    },
    {
      slug: 'posts',
      fields: [{ name: 'postTitle', type: 'text', required: true }],
    },
  ],
  plugins: [
    pluginUserGeneratedFields({
      collections: [
        {
          configCollection: {
            slug: 'post-categories',
          },
          valuesCollection: {
            slug: 'posts',
            groupName: 'Post Category Fields',
            relationshipFieldName: 'post-categories',
            useDefaultRelationshipField: true,
          },
        },
      ],
      debug: false,
    }),
  ],
})

How It Works

  • The plugin augments the configCollection with:
    • a blocks field (customFieldsOptions by default) for defining dynamic form fields
    • a hidden JSON field (customFieldsConfig by default) that stores normalized configuration
  • The plugin augments the valuesCollection with:
    • a relationship field to the config collection (optional if you provide your own relationship)
    • a group containing:
      • hidden config storage JSON
      • hidden values JSON rendered through a custom admin field component

Configuration

The plugin accepts:

  • collections: array of config/values collection pair definitions
  • debug: enables internal hidden JSON field visibility and debug logs

For exported config/types:

  • main plugin: payload-user-generated-fields-plugin
  • RSC export: payload-user-generated-fields-plugin/rsc
  • client export: payload-user-generated-fields-plugin/client
  • types export: payload-user-generated-fields-plugin/types

Local Development

  1. Copy dev/.env.example to dev/.env and update values.
  2. Install dependencies:
bun install
  1. Start the dev app:
bun run dev
  1. Open http://localhost:3000/admin.

Testing

  • Integration tests (Vitest):
bun run test:int
  • End-to-end tests (Playwright):
bun run test:e2e
  • Full suite:
bun run test

Build and Publish

Build distributable files:

bun run build

Publishing uses publishConfig to ship dist entry points for:

  • .
  • ./types
  • ./client
  • ./rsc