Rendering: the decision that matters most
Next.js can render a page at build time (static generation), on request (server rendering), or in the browser (client-side). For programmatic SEO only the first two are acceptable, because Google's first indexing pass and every AI crawler read the HTML the server returns without executing JavaScript. A client-rendered page returns a shell with a loading state; SerionFlow's own marketing site made this mistake and served 111 to 229 words of static HTML per page, which explained its "Crawled, currently not indexed" status and zero AI citations until the prerender was fixed.
Use static generation for pages whose data changes rarely and server rendering, with caching, for pages that must reflect fresh data. Incremental static regeneration blends the two.
The native pattern: dynamic routes, data, metadata, sitemap
Define a dynamic route such as app/guides/[slug]/page.tsx, load the page's content from a data source in the route, and render the full article with headings, tables, FAQ, and related links in the component. Export generateStaticParams to enumerate slugs at build time and generateMetadata to produce a unique title, description, and canonical per page. Add an app/sitemap.ts route that lists every generated URL with lastmod, and a robots route or static file. Structured data goes in a script tag rendered by the component so it is in the HTML.
| Concern | Mechanism | Check |
|---|---|---|
| Page generation | Dynamic route with generateStaticParams | Every slug builds; no client-only fetch for content |
| Metadata | generateMetadata per route | Unique title and description; canonical set |
| Structured data | JSON-LD script rendered in the component | Present in raw HTML; matches visible content |
| Sitemap | app/sitemap.ts | Lists all generated URLs with accurate lastmod |
| Internal links | Related-links component from the data source | Every page linked from a hub and siblings |
| Caching | Static generation or ISR | Time-to-first-byte stays low at scale |
Serving pages beside the app with Vercel rewrites
Vercel rewrites, configured in vercel.json or next.config, map a path on your domain to another destination, including an external origin. A rewrite for /explore/:path* to SerionFlow's origin serves SerionFlow-generated pages under your domain while the rest of the app is unchanged. The pages are first-party URLs, they share the Search Console property, SerionFlow maintains their sitemap, and nothing in the Next.js codebase changes beyond the rewrite. This is one of the two routing paths SerionFlow documents, alongside Cloudflare Workers.
Teams use this when they want the app to stay focused on product and a separate loop to research, draft, review, and refresh SEO pages from Search Console data.
Scale considerations
Build time grows with page count under static generation; use ISR or on-demand revalidation past a few thousand pages. Keep the data source, whether a database, a CMS, or JSON files, as the single source for content, metadata, and sitemap so they cannot drift. Generate related links from the data so no page is orphaned. Run a post-build check that fetches a sample of generated HTML and asserts word count, headings, canonical, and JSON-LD; it is cheap and catches regressions.
- ISR or on-demand revalidation for large sets.
- One data source for content, metadata, and sitemap.
- Post-build HTML assertions on a sample.
Crawlability checks before launch
Fetch a generated page with curl and confirm the article is there. Fetch it with Googlebot and AI crawler user agents and confirm 200 with full HTML; Vercel's firewall and any bot protection should allow them. Confirm robots.txt allows the generated paths and the sitemap is submitted. Validate JSON-LD on a sample. SerionFlow's free AI crawler access checker and robots.txt checker cover the fetch tests without an account.
Build it or route it
Build natively when you own the data, have engineering time, and want complete control over templates and rendering. Route to a platform when the pages must be discovered from Search Console and competitor evidence, drafted per intent, reviewed, and refreshed weekly, and when engineering time is better spent on the product. Many teams do both: native routes for data-driven pages and a rewrite to SerionFlow for research-driven ones.
Step by step
- 01
Choose rendering
Use static generation or server rendering for every programmatic route; never rely on client-side fetching for indexable content.
- 02
Create the dynamic route
Add a [slug] route that loads content from your data source and renders the full article with headings, tables, FAQ, related links, and JSON-LD.
- 03
Generate metadata and sitemap
Implement generateMetadata for unique titles, descriptions, and canonicals, and app/sitemap.ts listing every generated URL.
- 04
Add a rewrite if routing beside the app
In vercel.json or next.config, rewrite a path such as /explore/:path* to the external origin following its documentation.
- 05
Verify raw HTML
Fetch sample pages with curl and with crawler user agents; assert word count, headings, canonical, and JSON-LD are present.
- 06
Submit and monitor
Submit the sitemap in Search Console and Bing Webmaster Tools and check the Pages report after a week.
Clear answers
Frequently asked questions
Should programmatic Next.js pages use static generation or server rendering?
+
Either, as long as the full HTML is returned by the server. Static generation suits rarely changing content; server rendering with caching or ISR suits fresh data. Client-side rendering is the one option to avoid, because crawlers and AI engines read the initial HTML only.
How do Vercel rewrites let another platform serve pages on my domain?
+
A rewrite maps a path on your domain to another destination without a redirect, so the browser and crawlers see your URL while the content comes from the destination origin. SerionFlow documents a rewrite for its generated-page path; the Next.js app is otherwise unchanged.
How do I generate a sitemap for programmatic pages in Next.js?
+
Add an app/sitemap.ts route that reads the same data source as your pages and returns every URL with an accurate lastmod. Keep content, metadata, and the sitemap on one source so they cannot drift. Submit the sitemap URL in Search Console.
How do I check my Next.js pages are crawlable by AI engines?
+
Fetch a page with curl and with GPTBot, ClaudeBot, and PerplexityBot user agents, expecting 200 and the full article in the response. Check robots.txt and any bot protection on Vercel. A free AI crawler access checker automates the fetch tests.
Does SerionFlow require a Next.js app?
+
No. SerionFlow serves pages under your domain through either Vercel rewrites for any Vercel-deployed site or a Cloudflare Worker for domains on Cloudflare DNS. A Next.js app on Vercel is simply one of the most direct fits for the rewrite path.
Continue exploring
Related SerionFlow resources
More in Guides
- Programmatic SEO on Shopify: what works and what does not
- Programmatic SEO on Webflow: how to set it up and where it stops
- Programmatic SEO on WordPress: how to set it up and what to watch
- robots.txt for AI crawlers: how to allow or block GPTBot, ClaudeBot, and others
- robots.txt monitoring: how to detect changes and outages
- Title tag length and best practices
- How to connect Webflow to Google Search Console and use the data
- What is AI SEO and why does it matter?
Make the next move obvious
Let SerionFlow turn your market evidence into momentum.
Confirm the market, rank the opportunities that matter, create brand matched pages on your domain, and keep moving with controlled weekly intelligence.