vault backup: 2026-05-15 16:21:59
This commit is contained in:
parent
984f8ff8db
commit
bbf054198c
3 changed files with 65 additions and 2 deletions
|
|
@ -38,7 +38,7 @@
|
|||
| [[wiki/payloadcms/authentication-cookies\|Authentication — Cookie Strategy]] | HTTP-only cookie auth, `credentials: 'include'`, CSRF whitelist, cross-domain SameSite/Secure config, localhost gotcha | raw/authentication__cookies.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/authentication-custom-strategies\|Authentication — Custom Strategies]] | Replace/augment built-in auth: strategy shape, authenticate args, disableLocalStrategy, header-based token example | raw/authentication__custom-strategies.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/authentication-email\|Authentication — Email Verification & Password Reset]] | Email verification (`auth.verify`), forgot-password flow, `generateEmailHTML`/`generateEmailSubject` overrides, token usage | raw/authentication__email.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/plugins\|Official Plugins]] | All 10 official plugins — install + minimal config: SEO, Search, Form Builder, Redirects, Nested Docs, Multi-Tenant, Stripe, Sentry, Import/Export, MCP | raw/plugins__*.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/plugins\|Plugins Overview + Official]] | Plugin concept (config-in/config-out, execution order, use cases, addLastModified example), community plugins, all 10 official plugins with install + config | raw/plugins__overview.md, raw/plugins__*.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/plugins-api\|Plugin API]] | Build custom plugins: function signature, definePlugin, order, RegisteredPlugins augmentation, cross-plugin communication | raw/plugins__plugin-api.md, plugins__build-your-own.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/authentication-jwt\|Authentication — JWT Strategy]] | JWT via Authorization header, `removeTokenFromResponses`, external validation secret derivation (SHA-256 + slice 32) | raw/authentication__jwt.md | 2026-05-15 |
|
||||
| [[wiki/payloadcms/authentication-operations\|Authentication — Operations]] | All auth operations: access, me, login, logout, refresh, verify, unlock, forgot/reset password — REST, GraphQL, Local API | raw/authentication__operations.md | 2026-05-15 |
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: "PayloadCMS — Plugins (Overview + Official)"
|
||||
tags: [payloadcms, tech-patterns]
|
||||
topic: payloadcms
|
||||
sources: [plugins__overview.md, plugins__seo.md, plugins__search.md, plugins__form-builder.md, plugins__redirects.md, plugins__nested-docs.md, plugins__multi-tenant.md, plugins__stripe.md, plugins__sentry.md, plugins__import-export.md, plugins__mcp.md]
|
||||
created: 2026-05-15
|
||||
updated: 2026-05-15
|
||||
---
|
||||
|
||||
# PayloadCMS — Official Plugins
|
||||
# PayloadCMS — Plugins (Overview + Official)
|
||||
|
||||
## Overview
|
||||
|
||||
|
|
@ -16,6 +18,67 @@ created: 2026-05-15
|
|||
- Official plugins live in the [Payload monorepo packages directory](https://github.com/payloadcms/payload/tree/main/packages)
|
||||
- Community plugins: search `payload-plugin` topic on GitHub
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
- Sync collection data to HubSpot / CRM on change
|
||||
- Password-protect specific documents
|
||||
- Add full e-commerce backend
|
||||
- Add custom reporting views to admin panel
|
||||
- Encrypt specific collections
|
||||
- Integrate upload collections with S3 / Cloudinary
|
||||
- Add custom GraphQL queries or endpoints
|
||||
|
||||
## Example Plugin — addLastModified
|
||||
|
||||
Adds a `lastModifiedBy` relationship field to every collection:
|
||||
|
||||
```ts
|
||||
import { Config, Plugin } from 'payload'
|
||||
|
||||
export const addLastModified: Plugin = (incomingConfig: Config): Config => {
|
||||
const authEnabledCollections = incomingConfig.collections.filter(
|
||||
(collection) => Boolean(collection.auth),
|
||||
)
|
||||
|
||||
return {
|
||||
...incomingConfig,
|
||||
collections: incomingConfig.collections.map((collection) => ({
|
||||
...collection,
|
||||
fields: [
|
||||
...collection.fields,
|
||||
{
|
||||
name: 'lastModifiedBy',
|
||||
type: 'relationship',
|
||||
relationTo: authEnabledCollections.map(({ slug }) => slug),
|
||||
hooks: {
|
||||
beforeChange: [
|
||||
({ req }) => ({
|
||||
value: req?.user?.id,
|
||||
relationTo: req?.user?.collection,
|
||||
}),
|
||||
],
|
||||
},
|
||||
admin: { position: 'sidebar', readOnly: true },
|
||||
},
|
||||
],
|
||||
})),
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Register it:
|
||||
|
||||
```ts
|
||||
import { buildConfig } from 'payload'
|
||||
import { addLastModified } from './addLastModified'
|
||||
|
||||
export default buildConfig({
|
||||
plugins: [addLastModified],
|
||||
})
|
||||
```
|
||||
|
||||
> See [[wiki/payloadcms/plugins-api|Plugin API]] for the full `definePlugin` advanced API.
|
||||
|
||||
## Plugin Quick Reference
|
||||
|
||||
| Plugin | Package | Purpose |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue