How do I integrate Prerender.io with a Koa.js application?
Use the community-maintained koa-prerender package to route AI crawler requests through Prerender.io.
TL;DR
If your Node.js application uses the Koa framework, you can integrate Prerender.io with the community-maintained prerender-koa middleware. Get your Prerender.io token from your dashboard, follow the install instructions in the package README, then verify the integration with a curl test. Setup typically takes 15 to 30 minutes.
Before you start
A few quick checks save time later.
- You have a Node.js application running the Koa framework.
- You have an active Prerender.io account and access to your dashboard.
- You have permission to add npm dependencies and middleware to the Koa app.
ℹ️ Not sure whether prerender-koa is the right path for your stack, or whether you should integrate at the CDN layer instead? Ask Nexus, your AI integration assistant, inside your Prerender.io dashboard. Describe your setup and Nexus will recommend the right integration point.
Step 1: get your Prerender.io token from your dashboard.
Open your Prerender.io dashboard and go to Security and Access > Prerender Token. Copy the token. You will pass it to the middleware in Step 2.
Step 2: install and configure the koa-prerender package.
Follow the install instructions on README on GitHub. At a high level, you will run npm install prerender-koa, then register the middleware in your Koa app with your Prerender.io token. The README covers the exact API, options, and middleware ordering.
⚠️ Make sure is registered before your route handlers, not after. Middleware in Koa runs in the order it is added, so a misplaced registration will silently skip crawler traffic.
Step 3: verify your integration is working.
After deploying the change, confirm Prerender.io is intercepting crawler requests and returning rendered HTML.
Test with a curl command using a crawler user agent:
curl -v -A googlebot https://www.yourdomain.com/
Look for the x-prerender response headers and confirm the body is fully rendered HTML rather than a JavaScript shell.
→ See Verify your Prerender.io integration for the full verification procedure.
✅ Your integration is working when cached pages start appearing in your Prerender.io dashboard within 2 to 5 minutes of your first crawler request, and
curlwith a crawler user agent returns rendered HTML.
If you see the message "Prerender integration not detected," see What should I do if I receive a 'Prerender integration not detected' error? for the most common causes and fixes.
Related articles
- Node.js (Express.js) integration guide
- Node.js (Nuxt.js) integration guide
- Available integrations
- How can I integrate Prerender.io if my hosting platform doesn't allow direct server access?
💬 Still need help? If your Koa integration is not behaving as expected after the three steps above, our support team can help. Please include your prerender-koa configuration (or middleware setup code), the affected URLs, the curl output with a crawler user agent, and any error messages from the Prerender.io dashboard. → Contact us at support@perender.io