Linux 软件免费装
Banner图

Headless Deploy Panel for Vercel

开发者 eeeurico
更新时间 2026年10月12日 18:05
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

deploy headless vercel nextjs revalidate

下载

1.2.1

详情介绍:

Headless Deploy Panel for Vercel is for sites that use WordPress as a headless CMS with a front end hosted on Vercel. Your Vercel API token, deploy hook and revalidation secret are stored on your server and are only used by WordPress itself. They are never sent to the browser. This plugin is not affiliated with or endorsed by Vercel Inc. Inspired by Vercel Deploy for Strapi.

安装:

  1. Install and activate the plugin from Plugins → Add New, or upload the headless-deploy-panel-for-vercel folder to /wp-content/plugins/.
  2. In Vercel, create a deploy hook for your project and an access token.
  3. Go to Deploy Panel → Settings, paste the deploy hook URL and the token, and save.
  4. Optionally fill in the project name and team ID to only list that project's deployments.
  5. Go to Deploy Panel and click Deploy.
Only administrators (users who can manage options) can see deployments and start them. Anyone who can edit a post can revalidate it.

升级注意事项:

1.2.0 The plugin is now called "Headless Deploy Panel for Vercel". Settings from earlier versions are migrated automatically. 1.1.0 Security update: your Vercel token and deploy hook are no longer exposed in the browser. Settings are migrated automatically. If your revalidation endpoint should only accept WordPress, set a revalidation secret.

常见问题:

Which settings do I need?

The deploy hook URL and an API token are required for the deployments page. Project name and team ID are optional filters. The revalidation URL is only needed for the "Revalidate page" button.

How do I find my team ID?

Open your team in the Vercel dashboard and go to Settings → General. You can use the team ID or the team slug.

How does revalidation work?

When an editor clicks Revalidate page, WordPress sends a GET request to your revalidation URL with two query parameters:

  • path: the path of the post, for example /about/team/
  • post_type: the post type, for example page
If you set a revalidation secret, it is sent in the x-revalidate-secret header. Only published content can be revalidated.

Can you show an example Next.js route?

For the App Router, create app/api/revalidate/route.js: ` import { revalidatePath } from "next/cache" export async function GET(request) { if (request.headers.get("x-revalidate-secret") !== process.env.REVALIDATE_SECRET) { return Response.json({ message: "Invalid secret" }, { status: 401 }) } const path = request.nextUrl.searchParams.get("path") if (!path) { return Response.json({ message: "Missing path" }, { status: 400 }) } revalidatePath(path) return Response.json({ revalidated: true, path }) } ` Set REVALIDATE_SECRET in your Vercel project to the same value as the plugin's "Revalidation secret" setting, then use https://your-site.com/api/revalidate as the revalidation URL.

Can I show the revalidate box on custom post types?

Yes, with the headless_deploy_panel_meta_box_post_types filter: add_filter( 'headless_deploy_panel_meta_box_post_types', function ( $post_types ) { $post_types[] = 'product'; return $post_types; } );

Where is the source code?

On GitHub. Issues and pull requests are welcome.

更新日志:

1.2.1 1.2.0 1.1.0 1.0.4 1.0.3 1.0.2 1.0.0