Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.
Builder content link
Builder public api key
2b2378e44d724a7f8056a83e3b2d7fc9
What are you trying to accomplish
I want to import pages from an existing Nextjs site or repo into Builder.io
Screenshots or video link
Code stack you are integrating Builder with
Nextjs
Reproducible code example
I have an existing Nextjs website. I want to import the pages from it into Builder.io. When found instructions for importing Nextjs pages into Builder.io, it says that importing existing pages has been deprecated and that I need to use the Visual Copilot. But I can’t find the procedure for doing so in the documentation for Visual Copilot. The only information on this topic in the forum is over a year old.
Ok, I found this post which may answer my question. I’ll have to try it. What I’d like to find out is if there is something that will programmatically convert Nextjs pages to the JSON format Builder.io expects?
There isn’t a tool that will programmatically convert Next.js pages to the JSON format expected by Builder.io out-of-the-box. However, you can write custom scripts to achieve this. Here are the general steps:
Export your content to JSON: First, you need to export your Next.js content in a JSON format. This involves extracting your page’s structure and components into a JSON representation. Here’s a simplified approach:
These steps involve extracting the content and converting it into the expected JSON structure for Builder.io, then using the Builder.io Write API to add this JSON as entries in Builder.io.