@websolutespa/payload-plugin-seed
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@websolutespa/payload-plugin-seed

npm version

status alpha

Seed data plugin for PayloadCms.

Payload Seed data Plugin

A plugin that allows you to seed the initial data of one or more collections.

Requirements:

  • Payload version 2.28.0 or higher is required.

Installation

npm i @websolutespa/payload-plugin-seed

Usage

import { buildConfig } from 'payload/config';
import { seed } from '@websolutespa/payload-plugin-seed';

export default buildConfig({
  plugins: [
    // ...
    seed({
      collections: {
        label: () => [{
          id: 'label',
          value: 'Label',
        }],
      },
    }),
  ],
});

Plugin options

Option Type Description
collections Record<string, () => SeedItem[]> a record with collection slugs as keys and functions that return seedItems as results.
drop boolean | string[] drop all seeded collections or pass an array of collection slugs to drop.

Features

  • allows you to seed the initial data of one or more collections.
this library is for internal usage and not production ready

Readme

Keywords

Package Sidebar

Install

npm i @websolutespa/payload-plugin-seed

Version

0.0.1

License

MIT

Unpacked Size

33.3 kB

Total Files

5

Last publish

Collaborators

  • m.fort
  • giacomo_grassetti
  • federicodiluca
  • cbrualdi
  • actarian
  • websolute-admin