Adds a Maintenance global to the Payload admin with a close-the-site checkbox, heading, message and expected-back line. A gate function for the Next.js proxy serves a small 503 page with Retry-After while the site is closed. The admin, API and signed-in staff stay open. Requires Payload 3.80 or newer and a configured site address to read the switch.
Maintenance mode for Payload: close a site with a back-soon page and HTTP 503 from an admin switch, while the admin, API and signed-in staff keep working.
Installation
npm i @extantape/payload-plugin-maintenance0
Stars
0
Forks
0
Open Issues
1 weeks ago
Last Updated
388
Weekly Downloads
v0.3.0
npm Version
31.7 KB
Unpacked Size
0
Dependencies
00 since Nov 8
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
396+396 since Nov 11
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 396 |
| Dec 5, 2026 | 430 |
| Dec 4, 2026 | 600 |
| Dec 3, 2026 | 623 |
| Dec 2, 2026 | 639 |
| Dec 1, 2026 | 651 |
| Nov 30, 2026 | 467 |
| Nov 29, 2026 | 550 |
| Nov 28, 2026 | 529 |
| Nov 27, 2026 | 362 |
| Nov 26, 2026 | 337 |
| Nov 25, 2026 | 312 |
| Nov 24, 2026 | 280 |
| Nov 23, 2026 | 246 |
| Nov 22, 2026 | 355 |
| Nov 21, 2026 | 325 |
| Nov 20, 2026 | 314 |
| Nov 19, 2026 | 280 |
| Nov 18, 2026 | 262 |
| Nov 17, 2026 | 235 |
| Nov 16, 2026 | 219 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 304 |
| Nov 13, 2026 | 270 |
| Nov 12, 2026 | 167 |
| Nov 11, 2026 | 0 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1451746696-root)<a href="https://payloaddirectory.dev/plugins/1451746696-root"><img src="https://payloaddirectory.dev/badge/1451746696-root.svg" alt="Payload Directory"></a>README
Maintenance mode for Payload: close a site with a back-soon page and HTTP 503 from an admin switch, while the admin, API and signed-in staff keep working.
Status: early (0.3.0). From 0.2.0 it is published as @extantape/payload-plugin-maintenance; the earlier package name is deprecated in its favor. Unit tests cover the page, the global's access and the gate (switch, environment override, sign-in bypass, cache, failed reads, the Vercel protection header, the configured site address and redirects). The Vercel address defaults are tested with made-up values only, not on a Vercel deployment. The same approach already runs on a live site as a hand-written switch; this package hasn't been installed in a real site yet.
Retry-After, so search engines treat it as temporary. Nothing is cached, so reopening shows at once.bypassCookie: false.SITE_MAINTENANCE=on or off) overrides the switch, for when the admin itself is down or you want a deploy to start closed.Limits:
console.error), once per reason until a read works again. A missing or invalid address or apiRoute is also logged when the gate is built, which is when your proxy module loads.VERCEL_AUTOMATION_BYPASS_SECRET when it exists.On its own: Maintenance needs only Payload and a Next.js proxy. It adds one global and a gate, and reads the switch over your site's own API.
Needs: Payload ^3.80.0 as a peer dependency. No other EXTANT APE plugin is required.
Works with: any plugin, since it doesn't touch their collections or routes. The admin and API stay open while the site is closed, so other plugins' webhooks and scheduled jobs keep running. Nothing in it is built for one plugin in particular.
Color Theory: none yet. The maintenance page takes its colors from the theme option, with fixed defaults. Nothing reads Color Theory's tokens for it.
Family: Maintenance has no family on purpose: it sits beside every plugin. The families are a working draft, and Fulfillment is due to be split.
npm install @extantape/payload-plugin-maintenance
// payload.config.ts
import { maintenance } from '@extantape/payload-plugin-maintenance'
export default buildConfig({
// ...
plugins: [maintenance({ access: ({ req }) => req.user?.role === 'admin' })],
})
// src/proxy.ts (Next.js 16; middleware.ts on older versions)
import { maintenanceGate } from '@extantape/payload-plugin-maintenance/gate'
// Self-hosted: also set SITE_MAINTENANCE_ORIGIN, or pass `origin` here. See "Site address".
const gate = maintenanceGate({ brand: 'My Site' })
export async function proxy(request: NextRequest) {
const closed = await gate(request)
if (closed) return closed
// ...the rest of your proxy
}
export const config = { matcher: ['/((?!admin|api|_next|favicon.ico).*)'] }
The gate reads the switch from the address you configure. It takes the first of these that is set:
origin option, for example maintenanceGate({ origin: 'https://www.example.com' }).SITE_MAINTENANCE_ORIGIN environment variable.VERCEL_PROJECT_PRODUCTION_URL in production, VERCEL_URL in previews and other deployments. Production also uses VERCEL_URL when VERCEL_PROJECT_PRODUCTION_URL is absent. The project has to expose them to deployments.Self-hosted sites must set 1 or 2. On Vercel you need to set one only if the system variables aren't exposed, or if the address Vercel gives redirects to another one (for example example.com to www.example.com). In that case use the address that answers directly.
Write it as scheme and host, with a port if needed: https://www.example.com or http://127.0.0.1:3000. A path, query or sign-in details make it invalid; a base path goes in apiRoute. Write apiRoute with a leading / (for example /shop/api). The gate doesn't check for the slash itself. It checks that the resulting request stays on the configured address. Don't set apiRoute or adminRoute to '' or '/'. Any of these opens every path, so the gate never closes the site, even with SITE_MAINTENANCE=on, and it logs no warning about this.
The address can be internal, as long as your proxy can reach the API there. Use https unless the request stays on a network you trust. If you run several environments, give each its own address, so each reads its own switch.
The gate follows up to 3 redirects that stay on that address. It doesn't follow a redirect to another one, including http to https.
If the address is missing or invalid, the gate can't read the switch. The site stays open, even if "Close the site" is ticked, and the server log says why. An invalid value isn't replaced by the next one in the list. An apiRoute that would send the request anywhere other than that address is treated the same way, and nothing is sent. SITE_MAINTENANCE=on still closes the site, with the default words. After upgrading or changing the address, tick "Close the site" once and check that a signed-out visitor sees the page.
0.3.0 has a breaking change: the gate reads the switch only from a configured site address. Check each of these before you upgrade:
origin or set SITE_MAINTENANCE_ORIGIN. Use the scheme, host and optional port, with no path. A base path goes in apiRoute. Until this is set, the site is open to signed-out visitors, even if "Close the site" is already ticked.SITE_MAINTENANCE_ORIGIN.example.com to www.example.com, or to another domain): set SITE_MAINTENANCE_ORIGIN to the address that answers directly.http to https): configure the final address.read that used its argument: it now gets the configured address, or an empty string if there is none.If the site has to stay closed while you upgrade, set SITE_MAINTENANCE=on until that check is done. While it's set, the page shows whether or not the switch can be read, so unset it before the check.
access decides who can close and reopen the site and edit the page. It's a Payload Access function and goes to Payload as the global's update access as it is.
With no access, only users of your admin collection (admin.user in your Payload config, usually users) can change it. Anyone signed in through another auth collection, such as site members, is refused, and so is everyone if the config names no admin collection. Reading the global stays open to anyone: it holds nothing private.
Changed in 0.2.0 (2026-11-11): the default used to let any signed-in account change the switch, members of other auth collections included. Sites relying on the old default must pass the option, for example access: ({ req }) => Boolean(req.user).
Gate options: origin, slug, apiRoute, adminRoute, openPaths, envVar, bypassCookie, cacheSeconds, retryAfterSeconds, brand, lang, theme (light and dark colours), and read to supply your own reader. Your reader gets the configured address, or an empty string if there is none.
npm test # Vitest
npm run typecheck
npm run build # dist/
Releasing: see RELEASING.md.
MIT
payload theme
shadcn-style redesign of the Payload admin with dashboard, command palette, dark mode and live theme customizer
751.8k/wk36v3
payload plugin ab
A/B testing with page variants managed in the Payload admin and routed by Next.js middleware at the edge
741.0k/wk37v3
theme management
Theme presets, live preview and WCAG audit for editing site appearance from the Payload admin
73130/wk9v3
redirects
Managed redirects collection with a cache-backed Next.js middleware matcher and pluggable cache adapters
64176/wk16v3
styles
Manage UnoCSS design sets, shortcuts and design tokens from the Payload admin to generate site and admin CSS
6033/wk37v3
payload admin theme
shadcn-style admin theme for Payload configured from a global in the admin panel without rebuilds
5324/wk2v3