Answers about nextjs
Questions and answers from the Croct community about nextjs.
Where do I call identify on login in the App Router, server or client?
I want logged-in users recognized so their profile carries across visits. What I cannot figure out is where identify belongs in the App Router, a server…
How do I keep marketing pages static while personalizing only a few routes?
Most of our site is static marketing content and I want it to stay fully static. Only a handful of routes actually need personalized slots, things like the…
A content publish broke our prod build, was it because we did not pin the slot version?
Someone on the content side published a schema change to a slot and our Next app immediately started getting content that did not match our types. Here is…
Can I stream the page shell first and let the personalized slot fill in?
Next.js App Router. I want static-feeling TTFB. The page has one personalized slot below the fold and I would rather resolve it on the server than swap it in…
Why does my attributes object work in React but not in Next fetchContent?
took an attributes object that worked fine with useContent in a plain React app and moved it into a Next server fetchContent call. the values are just not…
We are adding a dozen audiences, will evaluation start to drag on each request?
We are scaling from two audiences to more than a dozen on the same set of slots. I am a bit worried about how it behaves when I add many audience, because…
Should I commit the generated slots.d.ts or let it regenerate on each build?
Project uses typed slot content. The CLI generates a slots.d.ts file. Deciding between two options. gitignore it and regenerate in CI, or commit it. Not sure…
Does server-side fetchContent add a TTFB penalty on my Next app?
i moved our hero personalization out of a client hook and into a server fetchContent call in the App Router. my assumption was that the extra server-side…
Best pattern for mixing fetchContent in Server Components with useContent in client islands?
I lead a team at an agency and we are writing down conventions for Croct in App Router projects before we roll it out across several client builds. The SDK…
Can I call fetchContent inside generateMetadata to personalize the page title?
We personalize the hero on our category pages and I would like the meta title and description to match the variant the visitor sees, instead of a generic…
Modeling staging and production as separate environments in croct.json5
Setting up Croct for our two ecommerce brands and I want to get the environment model right from day one. The main requirement: experiments running on staging…
Which A/B testing setup for a Next.js site on Vercel that marketing can actually use?
I manage marketing operations and we are re-evaluating our testing stack. Our site is Next.js on Vercel. The previous tool was a client-side flag SDK and on…