matija2209

payload plugin admin feedback

by matija2209
Publishing workflow
v3
^3.84.1

Overview

Summary generated from the README

Adds an admin-feedback collection and a floating widget that captures a message, page path, optional CSS selector and annotated screenshots. Reports trigger an email through the Payload email adapter. An optional issue tracker adds statuses, assignees, duplicate grouping and a grouped Issues view. Requires Payload 3.84.1 or newer and React 19.

Features

  • Floating widget for the admin panel and allowlisted Next.js frontend routes
  • Screenshot capture, paste or upload with a full-screen pen, arrow, rectangle and text editor
  • Email notification on each new feedback report
  • Uploads go to a configurable upload-enabled collection with startup validation
  • Optional tenant scoping of screenshot uploads
  • Opt-in issue tracker with status transitions, assignees and fingerprint-based duplicate grouping

Use cases

  • Collect bug reports with annotated screenshots from editors working in the Payload admin
  • Gather visitor feedback on selected frontend pages such as checkout or profile
  • Triage reported issues and notify reporters when their issue is closed

From the author

Floating admin feedback widget plugin for Payload CMS.

Installation

npm i @matija2209/payload-plugin-admin-feedback

5

Stars

0

Forks

0

Open Issues

5 days ago

Last Updated

496

Weekly Downloads

v1.3.0

npm Version

333.3 KB

Unpacked Size

0

Dependencies

GitHub stars

50 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20265
Dec 5, 20265
Dec 4, 20265
Dec 3, 20265
Dec 2, 20265
Dec 1, 20265
Nov 30, 20265
Nov 29, 20265
Nov 28, 20265
Nov 27, 20265
Nov 26, 20265
Nov 25, 20265
Nov 24, 20265
Nov 23, 20265
Nov 22, 20265
Nov 21, 20265
Nov 20, 20265
Nov 19, 20265
Nov 18, 20265
Nov 17, 20265
Nov 16, 20265
Nov 15, 20265
Nov 14, 20265
Nov 13, 20265
Nov 12, 20265
Nov 11, 20265
Nov 10, 20265
Nov 9, 20265
Nov 8, 20265
Nov 7, 20265
Nov 6, 20265
Nov 5, 20265
Nov 4, 20265
Nov 3, 20265
Nov 2, 20265
Nov 1, 20265
Oct 31, 20265
Oct 30, 20265
Oct 29, 20265
Oct 28, 20265
Oct 27, 20265
Oct 26, 20265
Oct 25, 20265
Oct 24, 20265
Oct 23, 20265
Oct 22, 20265
Oct 21, 20265
Oct 20, 20265
Oct 19, 20265
Oct 18, 20265
Oct 17, 20265
Oct 16, 20265
Oct 15, 20265
Oct 14, 20265
Oct 13, 20265
Oct 12, 20265
Oct 11, 20265
Oct 10, 20265
Oct 9, 20265
Oct 8, 20265
Oct 7, 20265
Oct 6, 20265
Oct 5, 20265
Oct 4, 20265
Oct 3, 20265
Oct 2, 20265
Oct 1, 20265
Sep 30, 20265
Sep 29, 20265
Sep 28, 20265
Sep 27, 20265
Sep 26, 20265
Sep 25, 20265
Sep 24, 20265
Sep 23, 20265
Sep 22, 20265
Sep 21, 20265
Sep 20, 20265
Sep 19, 20265
Sep 18, 20265
Sep 17, 20265
Sep 16, 20265
Sep 15, 20265
Sep 14, 20265
Sep 13, 20265
Sep 12, 20265
Sep 11, 20265
Sep 10, 20265
Sep 9, 20265
Sep 8, 20265
Sep 7, 20265
npm weekly downloads

487+478 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 2026487
Dec 5, 2026464
Dec 4, 2026436
Dec 3, 2026414
Dec 2, 2026192
Dec 1, 202618
Nov 30, 202618
Nov 29, 202614
Nov 28, 20268
Nov 27, 20268
Nov 26, 20267
Nov 25, 20267
Nov 24, 20264
Nov 23, 20264
Nov 22, 20266
Nov 21, 20266
Nov 20, 20263
Nov 19, 20263
Nov 18, 20265
Nov 17, 20264
Nov 16, 20264
Nov 15, 20265
Nov 14, 20265
Nov 13, 20265
Nov 12, 20269
Nov 11, 202610
Nov 10, 202614
Nov 9, 202614
Nov 8, 202614
Nov 7, 202614
Nov 6, 202615
Nov 5, 202611
Nov 4, 202611
Nov 3, 20267
Nov 2, 20267
Nov 1, 20264
Oct 31, 20264
Oct 30, 20263
Oct 29, 20263
Oct 28, 20260
Oct 27, 20261
Oct 26, 20262
Oct 25, 20267
Oct 24, 20268
Oct 23, 20268
Oct 22, 202615
Oct 21, 202615
Oct 20, 202614
Oct 19, 202613
Oct 18, 20269
Oct 17, 20268
Oct 16, 20268
Oct 15, 20261
Oct 14, 20261
Oct 13, 20261
Oct 12, 20263
Oct 11, 20263
Oct 10, 20263
Oct 9, 20263
Oct 8, 20263
Oct 7, 20263
Oct 6, 20263
Oct 5, 20261
Oct 4, 20260
Oct 3, 20260
Oct 2, 20261
Oct 1, 20261
Sep 30, 20261
Sep 29, 20262
Sep 28, 20262
Sep 27, 20262
Sep 26, 20266
Sep 25, 20265
Sep 24, 20266
Sep 23, 20266
Sep 22, 202616
Sep 21, 202620
Sep 20, 202621
Sep 19, 202617
Sep 18, 202617
Sep 17, 202616
Sep 16, 202616
Sep 15, 20267
Sep 14, 20263
Sep 13, 20262
Sep 12, 20263
Sep 11, 20264
Sep 10, 20265
Sep 9, 20266
Sep 8, 20268
Sep 7, 20269

Each point is npm's rolling 7-day download count.

Health Score

72/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1225573053-root.svg)](https://payloaddirectory.dev/plugins/1225573053-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1225573053-root"><img src="https://payloaddirectory.dev/badge/1225573053-root.svg" alt="Payload Directory"></a>
Updated Nov 30, 2026Created Apr 30, 2026Published Nov 30, 2026

README

Payload Admin Feedback Plugin header

payload-plugin-admin-feedback

Floating feedback/chat widget plugin for Payload CMS admin and selected Next.js frontend routes.

Features

  • Adds admin-feedback collection to Payload
  • Floating client widget with:
    • message input
    • current page path capture
    • optional CSS selector capture
    • current-tab-first screenshot capture, full-screen annotation, clipboard paste, and file upload
    • native HTML5 tools for pen, rectangle, arrow, text, undo, redo, clear, and revert
  • Email notification on feedback creation through configured Payload email adapter
  • Frontend allowlist route matching helper
  • Strict media collection validation with fail-fast startup errors

Install

pnpm add @matija2209/payload-plugin-admin-feedback

Requirements

  • payload ^3.84.1 (native advanced plugin API with definePlugin)
  • react ^19

Version Compatibility

Plugin VersionPayload Version
1.x.x^3.84.1

Setup

1. Register the plugin in your Payload config

import { buildConfig } from 'payload'
import { adminFeedbackPlugin } from '@matija2209/payload-plugin-admin-feedback'

export default buildConfig({
  // ...
  plugins: [
    adminFeedbackPlugin({
      emailTo: '[email protected]',
      fromLabel: 'Store Admin Feedback',
      fromName: 'Payload Admin',
      fromAddress: '[email protected]',
      allowScreenshotUpload: true,
      mediaCollectionSlug: 'files',
      strictMediaCollection: true,
      screenshot: {
        enabled: true,
        maxFileSizeBytes: 5 * 1024 * 1024,
        allowedMimeTypes: ['image/png', 'image/jpeg', 'image/webp'],
        capturePolicy: 'current-tab-first',
      },
      maxMessageLength: 3000,
      frontend: {
        enabled: true,
        include: ['/marketplace*', '/profile*'],
      },
      tenant: {
        enabled: true,
        collectionSlug: 'tenants',
        fieldName: 'tenant',
        formDataSlugKey: 'tenant',
        pathMarkers: ['pisarna', 'narocilnica'],
        resolveTenantId: async ({ req, tenantSlug }) => {
          // Optional host fallback (admin cookie, subdomain, …)
          return null
        },
      },
    }),
  ],
})

This registers the admin-feedback collection with custom endpoints (/submit, /upload, /upload/:id) — no additional API routes are needed.

Multi-tenant media uploads

When tenant.enabled is true, screenshot uploads set the configured relationship field on mediaCollectionSlug. Resolution order:

  1. Tenant slug in upload FormData (set automatically when tenantPathMarkers is passed to FrontendFeedbackWidget)
  2. Slug parsed from the request URL via tenant.pathMarkers
  3. tenant.resolveTenantId callback for host-specific logic

If your project stores uploads in a collection named files instead of media, set mediaCollectionSlug: 'files' exactly as shown above. The plugin validates that the target collection exists and is upload-enabled during startup.

2. Add the admin panel widget

The simplest way: let the plugin register it.

adminFeedbackPlugin({
  emailTo: '[email protected]',
  adminWidget: { enabled: true, title: 'Report a bug', submitLabel: 'Send report' },
  access: {
    create: ({ req }) => Boolean(req.user),
    read: ({ req }) => req.user?.role === 'admin' || { createdBy: { equals: req.user?.id } },
  },
})

The widget then shows for every signed-in user whose permissions allow creating feedback. Regenerate the import map (payload generate:importmap).

Or render it yourself in the admin layout:

In your Payload admin layout (src/app/(payload)/layout.tsx):

import { AdminFeedbackWidget } from '@matija2209/payload-plugin-admin-feedback/client'

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    <RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
      {children}
      <AdminFeedbackWidget />
    </RootLayout>
  )
}

The admin widget automatically sends authenticated requests (HTTP-only cookies via credentials: 'include').

3. Add the frontend widget

In your Next.js frontend locale layout (src/app/(frontend)/[locale]/layout.tsx):

import { FrontendFeedbackWidget } from '@matija2209/payload-plugin-admin-feedback/client'

export default async function LocaleLayout({ children, params }) {
  return (
    <html>
      <body>
        {/* ... */}
        <FrontendFeedbackWidget
          include={['/marketplace*', '/profile*', '/checkout*']}
          locales={['en', 'ru', 'sl']}
        />
        {children}
        {/* ... */}
      </body>
    </html>
  )
}

FrontendFeedbackWidget props:

PropTypeDefaultDescription
includestring[]requiredGlob-style route patterns to show the widget on. Supports * wildcard suffixes (e.g. '/profil*' matches /profile, /profile/orders/123).
localesstring[][]Supported locale prefixes. The widget strips the locale segment before matching against include patterns. If all your routes are non-prefixed, leave empty.
titlestring'Feedback'Widget title.
submitLabelstring'Send'Submit button label.
uploadLabelstring'Upload image'Upload button label.
tenantPathMarkersstring[][]Path markers — tenant slug is the segment before each marker; sent on upload.
tenantFormDataKeystring'tenant'FormData key for tenant slug.

How locale normalization works: When locales is ['en', 'ru', 'sl'], the widget strips the first path segment if it matches a locale. For example, /en/marketplace becomes /marketplace before checking the include patterns. This means you write patterns once and they work across all locales.

Plugin Options

  • access?: { create?, read?, update?, delete? } per-operation collection access; default: signed-in user for each. The endpoints check create.

  • collectionOverrides?: (collection) => collection adjust labels, admin group, fields; keep the slug admin-feedback

  • adminWidget?: { enabled?: boolean; title?: string; submitLabel?: string; uploadLabel?: string } register the admin widget as a provider

  • adminBaseUrl?: string absolute admin host for e-mail links (default config.serverURL, then NEXT_PUBLIC_SERVER_URL)

  • emailDateLocale?: string default 'sl-SI'

  • enabled?: boolean default true

  • emailTo: string | string[] required recipient address or addresses

  • fromLabel?: string label used by the widget and email output

  • fromName?: string optional sender name for feedback emails

  • fromAddress?: string optional sender address for feedback emails

  • email?: Config['email'] optional Payload email config injected only when config.email is not already set

  • allowScreenshotUpload?: boolean default true; enables image upload support in the widget, including annotated screenshot uploads

  • maxMessageLength?: number default 3000

  • mediaCollectionSlug?: string default 'media'; slug of the upload-enabled collection used for image uploads

  • strictMediaCollection?: boolean default true; when true, startup fails if mediaCollectionSlug is missing or not upload-enabled

  • screenshot?: { enabled?: boolean; maxFileSizeBytes?: number; allowedMimeTypes?: string[]; capturePolicy?: 'current-tab-first' | 'strict-current-tab' | 'any-surface' }

  • frontend?: { enabled?: boolean; include?: string[] }

  • frontendRouteMatcher?: (pathname: string) => boolean optional custom route matcher for frontend display logic

  • tenant?: TenantConfig optional multi-tenant upload scoping (enabled, collectionSlug, fieldName, formDataSlugKey, pathMarkers, resolveTenantId)

  • adminGroup?: string | Record<string, string> Admin nav group of the collection; default 'System'

  • tracker?: TrackerConfig opt-in issue tracker, see below

Issue Tracker

Turn the reports into a small issue tracker:

adminFeedbackPlugin({
  emailTo: '[email protected]',
  tracker: {
    enabled: true,
    // listView: true,        replace the list with the grouped Issues view
    // notifyReporter: true,  e-mail the reporter when their issue is closed
    // versions: true,        keep history (50 versions per issue)
    // assigneeFilterOptions: { roles: { contains: 'admin' } },
    // listViewLimit: 500,    newest reports the Issues view groups
  },
})

This changes the collection schema (new fields, statuses and a versions table). Run your migrations, then regenerate the import map (payload generate:importmap): the Issues view is a server component exported from @matija2209/payload-plugin-admin-feedback/rsc.

  • Statuses: new → triaged → in_progress → resolved / wont_fix / duplicate. Moves outside STATUS_TRANSITIONS are refused with a 400. A closed issue can only be reopened to triaged. duplicate needs duplicateOf.
  • Stamped by the server: resolvedAt and resolvedBy are set from the session when an issue closes and cleared when it reopens; new reports always start as new and unassigned. A request body cannot set any of these.
  • Duplicates: each report gets a fingerprint from its page path (record ids replaced by :id, query and hash dropped) and selector. The Issues view groups reports with the same fingerprint into one row that lists every report and reporter.
  • Issues view: open issues first, then priority, then newest. Filters for status, priority, assignee, page and text; quick links for Assigned to me, Unassigned and Reported by me. It queries with the viewer's access (overrideAccess: false), so whatever access.read allows is all the view shows.
  • Reporter e-mail: when an issue is resolved, won't fix or duplicate, the reporter gets the outcome, the resolution note and a link. Skipped when reporters close their own issue, or with req.context.skipTrackerNotify.

Screenshot Capture Behavior

  • allowScreenshotUpload: false disables image uploads from the widget entirely, including saving annotated screenshots.
  • screenshot.enabled: false disables browser screenshot capture while still allowing regular file uploads if allowScreenshotUpload remains true.
  • current-tab-first is the default. The widget prefers the active browser tab and still accepts window or screen capture if the browser returns a broader surface.
  • strict-current-tab requires the captured surface to resolve as a browser tab and fails otherwise.
  • any-surface allows the browser to offer any supported surface without tab-first constraints.
  • Captured, pasted, and uploaded images all open in the same full-screen HTML5 annotation editor and are exported as a flattened PNG before upload.

Storage Adapter Compatibility

The plugin uploads images through the resolved Payload upload collection, not directly to a specific storage adapter.

  • If your upload collection is configured with @payloadcms/storage-*, uploads are automatically stored there.
  • If strictMediaCollection is true (default), plugin initialization fails when the configured mediaCollectionSlug is missing or not upload-enabled.
  • If strictMediaCollection is false and the configured slug is missing, the plugin falls back to 'media' only when a 'media' collection exists and is upload-enabled.
  • A collection that exists but is not upload-enabled still fails validation.

Custom Frontend Matching

Use frontend.include for simple glob-style path matching. Use frontendRouteMatcher when widget visibility depends on custom logic that cannot be expressed as a simple allowlist.

adminFeedbackPlugin({
  emailTo: '[email protected]',
  frontend: {
    enabled: true,
  },
  frontendRouteMatcher: (pathname) => pathname.startsWith('/app') && !pathname.startsWith('/app/embed'),
})

Migration Notes

  • The plugin uses native Payload advanced plugin metadata (slug, order, options) via definePlugin.
  • Existing usage with adminFeedbackPlugin({ ...options }) remains unchanged.

License

MIT

Similar plugins