Skip to content
  • There are no suggestions because the search field is empty.

How to Integrate Prerender With Lovable Hosted Websites Using Cloudflare Workers Custom Domains

This guide helps you enable Prerender for a Lovable-hosted website while keeping your site on Lovable. It is designed for non-technical users and avoids common Cloudflare errors by using Cloudflare Workers Custom Domains as the “front door”.

What to Expect

This integration takes ~45 minutes. Prerender connects to your Lovable site through Cloudflare. It sits in front of your domain and intercepts requests from bots before they reach your site. Without Cloudflare managing your domain's DNS, there is no way for Prerender to slot into the request flow.

How it Works

Browser

 

Cloudflare

 

Prerender

 

Lovable

User or bot visits your domain

Routes the request

Intercepts bot requests, serves pre-rendered HTML

Hosts your site, continues working as normal

Nothing changes about how you use Lovable. You're only adding Cloudflare as the front door.

Before you start

You will need:

  • Your Lovable hosted URL (example: yourapp.lovable.app)

  • Your custom domain (example: yourapp.com)

  • Your Prerender token (available in your Prerender account)

  • Cloudflare account with your custom domain added (see setup instructions below)

Don't have Cloudflare set up?

Complete the Cloudflare setup first, then come back here and continue with the steps below. Here’s what the process involves:

  1. Create a free Cloudflare account: https://dash.cloudflare.com/sign-up
  2. Add your root domain (example: yourapp.com)
  3. Review your DNS records
  4. Log in to your domain registrar and replace the nameservers with Cloudflare's nameservers. The change propagation can take a few minutes up to a couple of hours, but you don't need to wait — continue to the next steps. Your custom domain may be temporarily unreachable during this time, but your site remains accessible via your Lovable hosted URL (yourapp.lovable.app).

Follow the detailed Cloudflare guide here.

Step 1: Important: Remove the custom domain from Lovable 

Disconnect your custom domain from Lovable. If your domain is connected inside both Lovable and Cloudflare, the two services create a “redirect loop”, and your site becomes unreachable. Only one service can be the “front door” at a time. In this setup, that’s Cloudflare.

  1. Open your Lovable project

  2. Go to Domains

  3. Remove the custom domain (example: yourapp.com, www.yourapp.com)

You can still use your custom domain publicly. Cloudflare will handle it and route requests to Lovable.


Step 2: Remove A record from Cloudflare

The existing records conflict with the Cloudflare Worker mapping you'll create and need to be removed first.

  1. Go to Domains and click on your domain
  2. In the left sidebar, click DNS → Records
  3. Delete all A records where the Name is www or yourapp.com


Step 3: Create a Cloudflare Worker

  1. Log in to Cloudflare

  2. Go to  Compute  Workers & Pages

  3. Click Create application

  4. Choose Start with Hello World!

  5. Name it something like lovable-prerender

  6. Click Deploy


Step 4: Add your Prerender token to the Worker

  1. Open your Worker

  2. Go to Settings

  3. Find Variables and Secrets

  4. Add a Secret:

    • Name: PRERENDER_TOKEN

    • Type: Plaintext

    • Value: (paste your Prerender token)


  5. Add the Lovable Upstream as a secret
    • Name: LOVABLE_UPSTREAM
    • Type: Plaintext
    • Value: Lovable hosted address (example: https://yourapp.lovable.app)

  6. Deploy


Step 5: Attach your custom domain(s) to the Worker (Custom Domain)

This is the key step that makes your domain work reliably through Cloudflare. By attaching your domain directly to the worker, you avoid common errors like Error 1014 and Error 1000.

  1. In your Worker, open Settings

  2. Click +Add next to Domains & Routes



  3. Select Custom domain

  4. Enter your domain (add as many custom domains as you need, including www)
    Screenshot 2026-03-23 at 10.20.28

  5. Cloudflare will automatically create the needed DNS/certificate setup

 When done, Cloudflare DNS will show a special Worker mapping for your domain.
Screenshot 2026-03-23 at 10.28.59


Step 6: Paste the Worker code

  1. In Cloudflare, open Compute  Workers & Pages → Your Worker

  2. Click Edit code

  3. Replace everything with the code on this link.

  4. Save and deploy


Final Check: Verify Prerender Is Working

Option 1: Simulate a Googlebot visit in Chrome 

To confirm Prerender is working, you’ll simulate a Googlebot visit in Chrome and check the response headers for x-prerender-request-id. If this header is present, Prerender is serving pre-rendered HTML to bots and your integration is complete.

For the full step-by-step verification process, see: Verify Your Prerender Integration

Option 2: Verify Integration within your Prerender Account

Navigate to the Verify Integration step in your Prerender account and submit your domain for verification.

You’re all set!

Prerender will serve pre-rendered HTML to bots, while real users continue getting your Lovable site.

Support

If you encounter any issues with this integration, please contact our support team for assistance. 

Was this article helpful?