Linux 软件免费装
Banner图

Hatch Connect - Astro Headless for Cloudflare

开发者 adityaarsharma
hmbhq
agusmu
hostmyblogco
更新时间 2026年10月26日 22:59
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

astro cloudflare headless decoupled headless-cms

下载

1.0.0

详情介绍:

Make your current WordPress site headless without moving it. Hatch Connect gives the site you already run a fast, modern Astro frontend and puts it online in your own Cloudflare account, all from your dashboard. You keep your host, your plugins, your content and the block editor you know. Your visitors get a separate, lightweight site. Everything runs inside your site. There is no Hatch server, no Hatch account and no Hatch-hosted deploy service. The plugin talks to Cloudflare directly, using a Cloudflare token (a long password) that you create and paste in. The problem Hatch Connect solves Going headless is usually a project, not a switch. Most headless WordPress solutions ask you to start over before anything works: Hatch Connect skips all of it. It connects to the WordPress setup you have today. What is headless WordPress? Think of a restaurant. WordPress is the kitchen, where the cooking happens and nobody wants to give it up. The Astro frontend is the dining room, which is what your guests see. A waiter (the REST API) carries finished dishes from one to the other. Classic WordPress does both jobs in one room, on every single visit: CLASSIC WORDPRESS Visitor --> your web server --> PHP runs --> database query --> HTML built --> Visitor (one machine, one busy kitchen, cooking and serving every table) Headless WordPress with Hatch splits the work in two: HEADLESS WORDPRESS WITH HATCH You write a post A visitor opens a page | | v v WordPress (the kitchen) --- REST API ---> Astro site on Cloudflare (the dining room) posts, pages, menus, the waiter builds the page and serves it media, users, plugins (hatch/v1) from Cloudflare's network Every website has a body and a head. The body is the back end, where you write and manage content. The head is the front end, the part visitors see. Headless means the head is taken off and put somewhere else. WordPress stays the body. A separate Astro site becomes the head. What you get Plugin bridge: your plugins keep working Hatch Connect detects the plugins you already use and passes their data to your frontend. Nothing to configure. If a plugin is not installed, its feature stays off. SEO features Performance features WordPress hardening and security Visitors use the frontend, so WordPress can close the doors it no longer needs. One Fortress Mode switch turns on every protection below, or choose them one by one. Customisable, and no coding needed How Hatch Connect compares with other headless WordPress solutions Faust.js, WPGraphQL, Next.js, Gatsby and headless CMS products are good tools, and each fits some teams better. Statements about other projects come from their public documentation and may change over time. What Hatch Connect cannot do External services This plugin connects to two Cloudflare services, and only after you set them up. Cloudflare API deploys your frontend using the token you paste in. Terms and Privacy policy Cloudflare Turnstile is optional spam protection, off until you add your keys. Terms and Privacy policy Source code The full source of everything in this plugin, including the compiled parts, is public at https://github.com/eticastudio/hatch. The plugin has two compiled parts. Third-party components and their licences are listed in THIRD-PARTY.txt inside the plugin.

安装:

Before you start Install the plugin
  1. Go to Plugins, Add New, search for Hatch Connect, then choose Install Now and Activate. You can also upload the zip with Plugins, Add New, Upload Plugin.
  2. The setup guide opens by itself. If you skip it, open Hatch in the admin menu and choose Run the setup guide again.
Create your Cloudflare token
  1. Open https://dash.cloudflare.com/profile/api-tokens and choose Create Token, then Create Custom Token.
  2. Add these permissions:
  3. Account, Workers Scripts, Edit (required)
  4. Account, Account Settings, Read (recommended, lets Hatch list your accounts)
  5. Zone, Zone, Read and Zone, Workers Routes, Edit (only if you want your own domain instead of a workers.dev address)
  6. Limit the token to one account and, for a custom domain, one zone.
  7. Copy the token. Cloudflare shows it only once.
Create the account your frontend reads with Hatch never creates users or passwords for you. You make one low-privilege account yourself:
  1. Go to Users, Add New and create a user with the Subscriber role.
  2. Open that user's profile and, under Application Passwords, create a new password. Copy it.
Hatch refuses any account that can edit other people's posts or manage users, plugins or the site. Deploy
  1. In the setup guide, paste the Cloudflare token and choose Check token.
  2. Choose where your frontend will live: a free workers.dev address or your own domain.
  3. Enter the user name and Application Password from the step above.
  4. Read the list of changes, tick the box that confirms them, and press Deploy.
  5. Open the live address Hatch shows you. Use the Status tab to see what works and what needs attention.
What Hatch changes on your site Nothing changes until you tick the consent box and press Deploy. Data Hatch stores Uninstalling

屏幕截图:

  • Design tab: pick a starter design, then set colours, fonts and layout.
  • Content tab: your site name and logo, post link format, homepage, menus and comment settings in one place.
  • Plugins tab: see which SEO, forms, shop and field plugins Hatch is reading from.
  • Performance tab: the Slim down and protect WordPress switch removes extras your frontend does not need.
  • Security tab: switch on protections such as locking the public data feed and login lockouts.
  • Status tab: a plain checklist of what is working and what needs attention.

升级注意事项:

1.0.0 First public release.

常见问题:

What is headless WordPress?

It means WordPress is only your back office. You write and manage content there as usual, and a separate frontend shows it to visitors. Hatch sets up that frontend on Cloudflare for you and keeps it in step with WordPress.

What is the difference between headless, decoupled and Jamstack WordPress?

In everyday use they mean nearly the same thing: the back end (WordPress) and the front end (what visitors see) are separate. "Headless" and "decoupled" describe the split. "Jamstack" usually describes a frontend built from pre-made files plus APIs. Hatch's frontend renders pages on request through Cloudflare Workers.

Do I need to know how to code?

No. The setup guide walks you through a Cloudflare token, a low-privilege WordPress account and one Deploy button. Developers can go further and build their own frontend against the REST API.

Is Hatch a headless WordPress plugin for Astro?

Yes. WordPress stays your back office and the block editor stays as it is. Hatch exposes your content over the WordPress REST API and deploys an Astro frontend to Cloudflare Workers in your own Cloudflare account. You can also build your own frontend (Astro, or any other) against the same hatch/v1 API.

Is Hatch an alternative to Faust.js or WPGraphQL?

It is a different route to the same goal, a headless WordPress site. Faust.js asks you to build a Next.js app and install the FaustWP and WPGraphQL plugins. WPGraphQL adds a GraphQL API that you query yourself. Hatch deploys a ready-made Astro frontend and reads WordPress over REST. See "How Hatch compares" in the Description.

Do I need WPGraphQL or GraphQL?

No. Hatch does not use GraphQL and does not need the WPGraphQL plugin. It uses the REST API that is built into WordPress.

Which is better, the REST API or GraphQL?

Neither is better in every case. Both are ways for one program to ask another for data. REST works like visiting an address: you request /wp-json/hatch/v1/... and get the data back as JSON. It is built into every WordPress site, so there is nothing extra to install. GraphQL works like filling in an order form: you send one query that lists exactly the fields you want. It needs an extra WordPress plugin such as WPGraphQL. Hatch is built on REST, which keeps the plugin list on your site short and lets any developer build a frontend against the hatch/v1 routes.

Is Hatch an alternative to building a Next.js or Gatsby frontend myself?

For many sites, yes. Instead of writing, hosting and maintaining your own app, you deploy a finished Astro frontend from your dashboard. If you need a fully custom app, build it against the hatch/v1 REST API.

What is Astro, and why Astro?

Astro is a web framework for content sites. It builds pages as plain HTML and CSS and sends very little JavaScript to the browser, which suits blogs, magazines, docs and shops that are mostly reading.

What is SSR? Will new posts show up without a rebuild?

SSR means server-side rendering: a server builds each page when a visitor asks for it. Hatch's frontend does this on Cloudflare Workers, so a published post can appear without rebuilding the whole site. Publishing also tells the frontend to refresh. By default pages are cached for 60 seconds and may be served stale for up to an hour while they refresh.

Will my SEO settings carry over?

Hatch reads the titles, descriptions and social settings you already set in Rank Math or Yoast SEO and passes them to the frontend. If no SEO plugin is active, the frontend uses your post title and excerpt. The frontend also provides a sitemap, an RSS feed, a robots.txt file and JSON-LD structured data. No tool can promise a ranking, so Hatch makes no ranking promises.

Will my site be faster?

Hatch sends less to the browser than a typical theme: no UI framework, no plugin CSS or JavaScript from WordPress. Real speed still depends on your content, images and settings, so measure your own site before and after, for example with PageSpeed Insights.

What is a Cloudflare token?

It is a long password that you create in your Cloudflare account. It lets Hatch upload your frontend, and only with the permissions you tick. The setup guide shows each step and the list of permissions to copy.

What is a Worker?

A Worker is a small program that runs on Cloudflare's network. Hatch uses one to serve your frontend. It gets a free address ending in workers.dev, and you can use your own domain instead.

Can I use my own domain?

Yes. Choose your domain in the setup guide. For a custom domain the token also needs Zone Read and Workers Routes Edit permissions.

Does Hatch create users or passwords?

Not for itself.

  • The deploy never creates users or Application Passwords.
  • You create a Subscriber account and an Application Password yourself, then enter them in the setup guide.
  • Hatch refuses any account that can edit other people's posts or manage users, plugins or the site.
  • Visitors can create their own accounts only if you switch on Frontend accounts and WordPress's "Anyone can register" is on.
  • Frontend sign-in and registration routes are off until you switch on Frontend accounts.
  • They use WordPress's own authentication, so login-limit and security plugins still apply.
  • Registration uses the core "New User Default Role".

How do I undo it?

Open Hatch, then the Connection tab, then Disconnect. The redirect stops and the saved Cloudflare token and frontend account password are forgotten. Revoke the frontend's Application Password in your profile afterwards. The Worker stays in your Cloudflare account until you delete it there, under Workers & Pages.

Am I locked in?

No. Your content stays in WordPress and your frontend lives in your own Cloudflare account. Disconnect turns the redirect off, and the hatch/v1 REST API works with any frontend you build.

Do I need to pay for Cloudflare?

The free Cloudflare plan includes Workers. Cloudflare sets the limits and prices; see https://developers.cloudflare.com/workers/platform/limits/. Hatch itself has no fees.

Does Hatch see my Cloudflare token?

Your token stays on your own server. It is encrypted before it is saved, sent only to Cloudflare, never returned to your browser and never written to logs. Hatch has no server of its own to receive it. Disconnect (Hatch, Connection) deletes it, and so does deleting the plugin.

What permissions does the token need?

Account, Workers Scripts, Edit is required. Account Settings, Read is optional. Zone Read and Workers Routes Edit are needed only for a custom domain. Use a token limited to one account and, for a custom domain, one zone.

Can I deploy somewhere other than Cloudflare?

Not in this version. Hatch deploys to Cloudflare only. The REST API works with any frontend you build.

Do I have to use the frontend Hatch deploys?

No. The hatch/v1 REST API works with any frontend you build. The one Hatch deploys (built with Astro) is the quick way to get started.

Can I change how the frontend looks?

Yes. Pick one of three designs (Editorial, Terminal or Docs) and set your own colours, fonts and layout in the Design tab. Developers can also take the open source Astro project from https://github.com/eticastudio/hatch and change it.

Do I need custom blocks?

No. Write with the standard block editor. Hatch reads what you write over REST.

Do I have to move hosts or migrate my site?

No. WordPress stays on your current host with your content, users and plugins exactly where they are. Hatch only adds a frontend in your Cloudflare account and, once you press Deploy, sends visitors from the raw WordPress address to it. Disconnect turns that off.

Which plugins does Hatch Connect work with?

Yoast SEO, Rank Math and RankReady for SEO. Fluent Forms, WPForms, Gravity Forms and Contact Form 7 for forms. WooCommerce for shops. ACF, Secure Custom Fields, Meta Box and Pods for custom fields. Custom Post Type UI and JetEngine for custom post types. Redirection for redirects. FluentSMTP, WP Mail SMTP, Post SMTP and Easy WP SMTP for email. If a plugin is not installed, its feature stays off. See "Plugin bridge" in the Description.

Does it work with WooCommerce?

Yes. When WooCommerce is active the frontend includes shop, product, cart, checkout, order summary and account pages. Stripe and PayPal payment fields appear on the checkout page only if you switch on that gateway in WooCommerce and add its public key.

Does it work with Elementor, Divi, Bricks or WPBakery?

No. Layouts built with a page builder depend on the builder's own CSS and JavaScript from your WordPress theme, which the Astro frontend does not load. Content written in the block editor works.

Isn't headless overkill for a small blog?

Possibly. A small blog on a good classic theme works fine. Headless pays off when you want a lighter frontend, a separate public site from your admin, or a custom design without theme limits. Hatch aims to make that choice cheap to try, because Disconnect undoes the WordPress side.

My site is on localhost or behind a firewall. Can I deploy?

You can check your token and deploy, but the deployed frontend runs on Cloudflare's network and must be able to reach your site over https. Use a public address or a tunnel.

Is my data sent anywhere without my consent?

No. Every external request is listed under External services and starts only after you enter the relevant token, key or address.

Why do the permalinks and links change?

See "What Hatch changes on your site". The redirect and the frontend links start when an administrator presses Deploy. The permalink change happens only if the administrator ticked the box for it.

更新日志:

1.0.0