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

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.

⚠️ This integration is community-maintained, not officially supported by Prerender.io. We provide this guide and link to the package, but the koa-prerender package itself is maintained by RisingStack on GitHub. Compatibility with future Koa versions is your responsibility to verify.

TL;DR

If your Node.js application uses the Koa framework, you can integrate Prerender.io with the community-maintained koa-prerender 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 koa-prerender 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 in the koa-prerender README on GitHub. At a high level, you will run npm install koa-prerender, 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 koa-prerender 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:

 
bash
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 curl with 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

 

💬 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 koa-prerender 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

 

Was this article helpful?