This guide provides all the necessary information for integrating Prerender into your NextJS project to boost your ranking on search result pages.
Video guide:
Prerender token
The Prerender token has been relocated. It can now be found under the Security and Access menu under Prerender Token.
Text guide:
- Copy the Integration's source code from here to your NextJS project's SRC directory. Make sure to name the file middleware.js.
- Add your Prerender token to the middleware.js file's source code.
- You can add the Prerender token to the integration's source code by replacing process.env.PRERENDER_TOKEN with your Prerender.io Token from the Security and Access menu.
- Alternatively, add your Prerender token as an environment variable. In this case, the name of the environment variable must be PRERENDER_TOKEN.
The exact method depends on your setup. For example, you can add it from the Project Settings menu under the Environment variables settings in Vercel.
- You can add the Prerender token to the integration's source code by replacing process.env.PRERENDER_TOKEN with your Prerender.io Token from the Security and Access menu.
- Push and commit your changes after the new version is deployed the integration should work.
- Test your integration based on this guide.