Answers about nextjs
Questions and answers from the Croct community about nextjs.
Why does attributes work in useContent but not in fetchContent on the server?
In my client components I pass attributes to useContent and my audience matches fine: I copied the same options object into a server call and the variable…
Server fetch throws a missing environment variable error, what am I missing?
My client-side setup behaves correctly. The provider mounts, the hooks return content, all good. The moment I add a server-side fetchContent call it fails…
What is the cleanest way to render a personalized hero in an App Router server component?
wiring my first Croct slot into an App Router page. the hero is personalized and I want it to arrive already rendered, not pop in and swap after the page…
Should I pin the slot version in fetchContent or is leaving it off fine?
Some examples use a slot id like home-hero@2 and others just the bare home-hero. What is the practical difference between the two? We publish content changes…
Did Croct stay fast during our campaign traffic spike on Next?
we ran a big campaign yesterday that multiplied traffic on our personalized Next routes for the whole day, and i was braced for latency to climb once the load…
If Croct is slow or down, will my Next page render blank?
Before we ship this I want to be sure a slow or failed content request cannot leave a personalized section empty on the page. A blank hero because a request…
We stay on Contentful for content. How do I actually wire Croct into our Next.js app?
Keeping content in Contentful, no plan to re-platform the CMS. We dropped our old add-on and now want personalization and A/B testing on the Next.js frontend.…
How do I keep most of the page cached but personalize one slot?
marketing page, mostly static, built with ISR and revalidate on a tag. only one slot near the top needs to be personalized per visitor. everything else is the…
Multi-tenant Next app, which tokenScope keeps one tenant's identity out of another?
We build a multi-tenant SaaS where a single browser can switch between tenant workspaces in the same session. My concern is identity bleed: I do not want a…
On logout should I call anonymize, and does it wipe the profile I built up?
Our Next app calls identify on login and I am now adding the logout side of the behaviour. Two things I want to get right before I ship it. First, is…
Sharing the same visitor identity between our marketing site and app subdomain
Our marketing site runs on the apex domain and the product runs on an app subdomain, both Next apps. Right now a visitor who crosses from marketing to the app…
How do I stop my e2e tests from sending real Croct events in CI?
Our Playwright suite runs against a preview build in CI, and I do not want those runs doing two things: polluting real event data with synthetic test…