Webflow Cloud supports the Next.js and Astro frameworks, though running either on the Workers runtime may require specific configuration or adjustments. This page offers guidance on framework-specific setup, limitations, and best practices to help you get the most out of your deployment.
For general deployment and environment configuration, see the configuration guide. This page focuses on requirements and recommendations unique to each supported framework.
Webflow Cloud deploys Next.js apps using the OpenNext Cloudflare adapter, an open-source tool that brings Next.js to the edge. It handles translating Next.js’s server-side features to the edge runtime, including routing, API routes, static assets, and server functions, enabling modern Next.js apps to run with minimal changes.
To run your Next.js app on Webflow Cloud, you may need to adapt some features and provide custom configuration. See the sections below for details.
Webflow Cloud automatically optimizes images for better performance and reduced bandwidth usage. Here’s how different image types are handled:
When you use the <Image /> component with local images Webflow Cloud automatically:
Example:
Webflow Cloud automatically handles routing through your base path when using the Next.js Image component, so you don’t need to manually add assetPrefix to your image paths.
When you use the <Image /> component with external images, including those from your main Webflow site, Webflow Cloud doesn’t automatically resize the image. However, you can still benefit from other Image component features like lazy loading.
img tagsWhen using regular <img> tags, no automatic optimization occurs. For assets in your /public folder, include assetPrefix in the src path to ensure proper CDN caching:
Some Next.js features have limitations when running on Webflow Cloud:
use cache directive isn’t yet supportedSee the OpenNext Cloudflare adapter documentation for current feature support.
Webflow Cloud deploys Astro apps using the @astrojs/cloudflare adapter. The adapter supports server-side rendering, API routes, and advanced features like server islands and sessions—translating Astro’s server functionality to the Workers runtime for seamless edge deployment.
Most features work out of the box, but some Node.js APIs and integrations may need additional configuration. For details and advanced usage, see the Astro Cloudflare integration guide. However, we’ve outlined the most common adjustments below.
Be sure to add the client:load directive to your components to load your components.
By default, all Astro routes are server-rendered on the edge. For static routes (such as a custom 404 page or privacy policy), enable pre-rendering to generate and serve them as static assets for faster loading.
Astro provides several ways to access environment variables, depending on where your code runs:
import.meta.env for built-in variables like BASE_URL and ASSETS_PREFIX, and for any custom variables prefixed with PUBLIC_. Using the PUBLIC prefix will make the variable available on both the server and the client.Astro.locals.runtime.env in Astro server-side components to access custom environment variables.locals.runtime.env in API routes to access custom environment variables.To use locals.runtime.env variables during local development, create a dev.vars file in your app root. Use the same format as a standard .env file to define your environment variables.
To ensure Astro API routes work on the Edge runtime, add the following line to the top of your route:
You may encounter issues with POST requests containing form data. Disable Astro’s built-in CSRF protection and implement your own CSRF handling.
In your astro.config.mjs file, add the following:
Astro serves all static assets (such as images, stylesheets, and icons) from the public directory. Be sure to place all static files (images, CSS, fonts, etc.) in the public directory at your app root.
To use Tailwind CSS in your Astro app, use the @tailwindcss/vite plugin to ensure compatibility. Once you’ve created your Astro app from the CLI, follow the instructions in the Tailwind CSS integration for Astro guide to set up Tailwind CSS.
@astrojs/tailwind is deprecated and not supported on Webflow Cloud.
Third-party templates and guides may still reference it, but it’s not recommended to use it. Instead, upgrade to the latest version of Tailwind CSS and use the @tailwindcss/vite plugin to ensure compatibility.