How to Integrate Prerender.io with Lovable-Hosted Websites
Lovable hosts apps behind Cloudflare proxies, which normally require your domain’s A record to point to a Cloudflare IP address. In this setup, Prerender.io would typically need Cloudflare’s Orange-to-Orange (O2O) service, available only on the Enterprise plan. However, there are now two supported integration paths: the standard method for default Lovable-hosted domains and an alternative method for custom domains using Cloudflare Workers and CNAME records. This guide covers both approaches without relying on the O2O service.
Without custom domain at Lovable:
The most effective solution is to move your hosting from Lovable while maintaining your existing codebase. We recommend using either Netlify or Cloudflare Pages, with a preference for keeping your DNS management in Cloudflare.
Options:
Step-by-Step Integration Guide
Netlify + Cloudflare (Recommended)
-
Export your code from Lovable:
- Connect your GitHub account in Lovable (use the GitHub button in the top right)
- Push your project to a GitHub repository
- Alternatively, enable code editing in Account Settings → Labs → Enable Code Editing, then download or copy your code manually
-
Set up hosting on Netlify:
- Create a Netlify account if you don't have one
- Connect your GitHub repository to Netlify
- Configure your build settings for your React.js application
- Deploy your site on Netlify
-
Configure DNS in Cloudflare:
- Create a CNAME record at your apex domain (e.g.,
yourdomain.com
) pointing toapex-loadbalancer.netlify.com
- Cloudflare may warn that this is unusual, but it works correctly
- For the www subdomain, create another CNAME record pointing to your Netlify app URL (e.g.,
your-site.netlify.app
)
- Create a CNAME record at your apex domain (e.g.,
-
Set up your domain in Netlify:
- Add your domain in Netlify's domain settings
- Set it as the primary domain
- Integrate Prerender into Cloudflare by following this guide.
Cloudflare Pages
If you prefer to keep everything within the Cloudflare ecosystem:
-
Export your code from Lovable :
- Connect your GitHub account in Lovable (use the GitHub button in the top right)
- Push your project to a GitHub repository
- Alternatively, enable code editing in Account Settings → Labs → Enable Code Editing, then download or copy your code manually
-
Deploy to Cloudflare Pages:
- Set up a new project in Cloudflare Pages
- Connect your GitHub repository
- Configure build settings for your React.js application
- Cloudflare Pages supports Vite/React apps with automatic builds
-
Configure your domain in Cloudflare Pages settings
-
Integrate Prerender into Cloudflare by following this guide.
Performance Considerations
Both solutions offer excellent performance:
- Netlify + Cloudflare combination has proven reliable for many users over extended periods
- Cloudflare Pages may offer slightly better performance through their global CDN if you prefer keeping everything in the Cloudflare ecosystem
Troubleshooting
If Prerender integration isn't working after migration:
- Verify DNS records are correctly configured
- Ensure your domain is set as primary in Netlify (if using Netlify)
- Check that Cloudflare's proxy settings are correctly configured
- Confirm that your Prerender service worker is properly implemented
If you have your own custom domain set in Lovable, then follow this guide:
If your Lovable app uses a custom domain, you can fix SEO visibility using Cloudflare Workers and Prerender.io. This setup serves pre-rendered pages to bots while keeping the regular fast SPA experience for users, no code changes needed.
How It Works
Lovable apps are SPAs, so bots often only see:
<div id="root"></div>
With Cloudflare and Prerender.io:
-
Bots → Cloudflare Worker → Prerender.io → Full HTML
-
Users → Cloudflare Worker → Lovable App
Benefits:
-
SEO-ready, fully rendered HTML
-
Fast load times for users
Step 1: Cloudflare Setup
-
Create a free Cloudflare account.
-
Add your domain and switch your nameservers.
-
Create CNAME records (not A records):
-
@
→ your-lovable-domain (for example:yourappname.lovable.app
) -
www
→ your-lovable-domain
-
-
Enable the orange cloud (Proxied) option.
Important: Do not use A records. CNAMEs are required for CloudFlare to work correctly.
Step 2: Prerender.io Setup
-
Follow our Cloudflare guide
-
Follow the prompts to:
-
Create the Cloudflare Worker
-
Add the provided code and your Prerender token
-
Deploy to your domain routes
-
Step 3: Test Your Setup
Run:
curl -H "User-Agent: Googlebot" https://yourdomain.com
You should see full HTML output, not <div id="root"></div>
Support
If you encounter any issues with this integration, please contact our support team for assistance.