0.0.4 • Published 7 months ago

@websolutespa/payload-plugin-seed v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@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

OptionTypeDescription
collectionsRecord<string, () => SeedItem[]>a record with collection slugs as keys and functions that return seedItems as results.
dropboolean \| 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
0.0.3

7 months ago

0.0.2

7 months ago

0.0.4

7 months ago

0.0.1

8 months ago