Integration Guide

Integration Examples

Get prerendering configured in your stack with copy-paste examples. Log in to see personalized configuration examples.

Why we don’t render in real time by default
A worker-first, cache-then-serve approach is more reliablefor crawlers and rankings.
  • Crawlers have tight timeouts and crawl budgets. Real-time rendering can cause timeouts/soft-fails and reduced indexing.
  • Real-time headless rendering has variable latency (cold starts, third-party services, concurrency spikes).Cached delivery is consistently fast (under 200ms typical).
  • On cache miss, returning 404 quickly and queuing a render gives a fast response now and high-quality HTML on the next crawl.
Real-time mode (optional)

You can implement synchronous rendering, but expect slower responses for bots and higher risk of crawler timeouts.If you choose this, restrict it to a few critical routes, set strict timeouts, and prefer pre-warming via recache APIs.

Get Your Personalized Configuration

Log in to see your organization UID automatically included in all configuration examples below. This makes setup much faster and eliminates copy-paste errors.

Log In
Web Server
Easy
2 min
Apache

.htaccess Configuration

Configure Apache server with .htaccess for seamless bot detection and prerendering
Web Server
Easy
3 min
Nginx

Server Block Configuration

High-performance Nginx configuration for production environments
Framework
Easy
1 min
Express.js

Middleware Integration

Add BotRender middleware to your Express.js application with full TypeScript support
SPA Framework
Easy
2 min
React SPA

Express Server Setup

Configure Express server for React Single Page Applications with Create React App
SPA Framework
Easy
2 min
Vue.js SPA

Express Server Setup

Express server configuration for Vue.js Single Page Applications
SPA Framework
Easy
3 min
Angular SPA

Express Server Setup

Express server configuration for Angular Single Page Applications
Configuration Examples
Copy-paste ready configurations for your tech stack

Apache .htaccess Configuration

Configure Apache server with .htaccess for seamless bot detection and prerendering

Apache Configuration
# Enable URL rewriting
RewriteEngine On

# Set your BotRender organization UID  
SetEnv BOTRENDER_ORG_UID "YOUR_ORGANIZATION_UID"

# Detect comprehensive list of crawlers, bots, and AI platforms
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|slurp|duckduckbot|baiduspider|yandexbot|sosospider|exabot|facebot|ia_archiver|chatgpt-user|gptbot|openai|anthropic-ai|claude-web|google-extended|googleother|bingpreview|perplexitybot|cohere-ai|cohere-crawler|bytespider|bytedance|you-bot|neevabot|huggingfacebot|ccbot|airesearchbot|diffbot|scaleai|facebookexternalhit|facebookbot|twitterbot|linkedinbot|pinterestbot|redditbot|discordbot|telegrambot|slackbot|whatsapp|vkshare|skypeuripreview|snapchat|embedly|quora|showyoubot|outbrain|flipboard|medium|tumblr|ahrefsbot|semrushbot|mj12bot|dotbot|rogerbot|blekkobot|domainappender|spbot|applebot|googlebot-mobile|bingbot-mobile|adsbot-google|mediapartners-google|archive.org_bot|wayback|wget|curl|w3c_validator|validator.nu|html5validator|csscheck|jigsaw|newsbot|feedfetcher|rssbot|feedly|inoreader|shoppingbot|pricebot|shopify|uptimerobot|pingdom|monitor|statuspage) [NC]

# Skip static files
RewriteCond %{REQUEST_URI} !\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|woff2|svg|eot)$ [NC]

# Behavior on first crawl (cache miss):
# - service.botrender.com returns 404 to the crawler and queues a render job
# - Next crawl will receive the prerendered HTML from cache
# Note: Human users are not affected; serve your app as normal.
# Proxy the request to BotRender with organization UID
RewriteRule ^(.*)$ https://service.botrender.com/%{ENV:BOTRENDER_ORG_UID}/%{HTTP_HOST}/$1 [P,L]

# Set headers for proxied requests
<IfModule mod_headers.c>
    RequestHeader set X-Botrender-Token "YOUR_TOKEN"
</IfModule>

# When BotRender returns 404 (cache miss), fall back to SPA index.html
# This lets crawlers see your normal SPA on first crawl while a render job is queued
ProxyErrorOverride On
ErrorDocument 404 /index.html

Next Steps:

  • • Replace YOUR_TOKEN with your API key from Dashboard Settings
  • • Test the configuration with a bot user agent
  • • Monitor your dashboard for crawler visits