@websolutespa/payload-plugin-seed
v0.0.1
Published
Seed data plugin for PayloadCms
Readme
@websolutespa/payload-plugin-seed
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.