{"library":"payload","title":"Payload CMS","description":"Payload is an open-source, TypeScript-first headless CMS and application framework built on Node.js and React, frequently integrated with Next.js for full-stack applications. It is currently at version 3.83.0 and maintains an active release cadence, with multiple minor versions and bug fixes published monthly, indicating continuous and rapid development. A key differentiator is its code-first configuration approach, allowing developers to define collections, globals, and other configurations programmatically using TypeScript. This facilitates strong version control, type safety, and a developer-centric workflow, distinguishing it from CMS platforms that primarily rely on UI-driven configuration. Payload also provides a robust GraphQL API out-of-the-box, flexible authentication mechanisms, and a customizable, self-hosted admin panel, making it suitable for both content management and complex application backends.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install payload"],"cli":{"name":"payload","version":null}},"imports":["import payload from 'payload';","import { buildConfig } from 'payload/config';","import { CollectionConfig } from 'payload/types';","import type { User } from 'payload/generated-types';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { buildConfig } from 'payload/config';\nimport path from 'path';\n\nconst Users = {\n  slug: 'users',\n  auth: true,\n  admin: {\n    use=>: 'Email',\n  },\n  fields: [\n    {\n      name: 'name',\n      type: 'text',\n    },\n  ],\n};\n\nexport default buildConfig({\n  serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL ?? 'http://localhost:3000',\n  admin: {\n    user: 'users',\n  },\n  collections: [\n    Users,\n    {\n      slug: 'posts',\n      fields: [\n        {\n          name: 'title',\n          type: 'text',\n          required: true,\n        },\n        {\n          name: 'content',\n          type: 'richText',\n        },\n        {\n          name: 'author',\n          type: 'relationship',\n          relationTo: 'users',\n        },\n      ],\n    },\n  ],\n  typescript: {\n    outputFile: path.resolve(__dirname, 'payload-types.ts'),\n  },\n  graphQL: {\n    schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),\n  },\n});\n\n// To run this, you would typically have a server entry point like:\n// import payload from 'payload';\n// import express from 'express';\n// import { connect } from 'mongoose'; // or '@payloadcms/db-postgres'\n\n// const app = express();\n\n// async function start() {\n//   await connect(process.env.MONGODB_URI ?? 'mongodb://localhost/payload');\n\n//   await payload.init({\n//     secret: process.env.PAYLOAD_SECRET ?? 'super-secret-default-key',\n//     express: app,\n//     onInit: () => {\n//       payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);\n//     },\n//   });\n\n//   app.listen(3000, async () => {\n//     payload.logger.info('Express is listening on port 3000');\n//   });\n// }\n\n// start();","lang":"typescript","description":"This quickstart demonstrates a minimal Payload configuration with two collections (Users and Posts), including authentication, basic fields, and relationship fields. It shows the `buildConfig` utility and how to define schemas. It also outlines the typical server initialization process.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}