NuxtHub on Workers
@nuxthub/core >= v0.8.24
.After much development (and many teasers), we're thrilled to announce that NuxtHub now supports deploying to Cloudflare Workers!
Why Workers
For a while, Cloudflare have been releasing exciting new features such as observability & persistent logs, workflows, cron triggers, and much more. However, these features are only available on Cloudflare Workers, and were not brought to Cloudflare Pages.
Now with the introduction of static assets, suddenly it is now viable to deploy Nuxt applications to Cloudflare Workers, and we can benefit from the new features and services available on Cloudflare Workers.
Real-time
Projects deployed to NuxtHub on Workers also fully support Nitro WebSocket, allowing you to create real-time experiences on NuxtHub. Simply set nitro.experimental.websocket
to true
in your nuxt.config.ts
, create your websocket server route with crossws, and deploy!
Under the hood this is powered by Cloudflare Durable Objects. Nitro and NuxtHub magically takes care of everything related to the Durable Object, from building to deploying.
Check out our multiplayer-globe template for an example of using websockets (live demo).
Deploying to Workers
Get started by creating a new project and selecting the Cloudflare Workers type on the NuxtHub Admin or with the latest version of the nuxthub
CLI (v0.9.0). All our templates are fully compatible with NuxtHub on Workers.
We're working on a migration path to help simplify the switch from Cloudflare Pages to Workers. Until then, you can deploy your existing Nuxt apps to Cloudflare Workers by setting hub.workers
to true
, and linking them to a separate new project with the Workers type, then manually moving any data stored in your database, KV or blob.
Workers Scripts
permission on your Cloudflare API token.- Open Cloudflare User API Tokens
- Find your NuxtHub token(s)
- Add the
Workers Scripts > Edit
permission - Save the changes
Connect a different Cloudflare account
> Create a token
.What's next
Throughout the next few weeks, we'll be enhancing NuxtHub on Workers with new features and integration with more Cloudflare Workers-specific services, including:
- Observability: Automatically ingest, filter, and analyse logs
- Queues: Process background tasks effectively at scale
- Cron Tasks: Run Nitro tasks automatically on a schedule
- Environments: Bringing the preview environment to NuxtHub on Workers
Let us know your feedback by joining our Discord, following us on X, or emailing us at hub@nuxt.com.