Upgraded to Next.js 15 and cookies() is async now, does the Croct proxy need changes?
Bumped a project to Next.js 15. Request APIs like cookies() and headers() are async now. Do the Croct proxy or my fetchContent calls need code changes, or does the SDK handle it internally?
{ "next": "15.1.4", "react": "19.0.0", "@croct/plug-next": "0.13.2"}middleware.ts is just the proxy export, nothing custom
Was this helpful?
1 answer
AI
Accepted answerNo changes needed on your side. The setup stays exactly:
export {proxy} from '@croct/plug-next/proxy';The proxy manages the ct.client_id and ct.user_token cookies internally, so your application code never touches cookies() directly for Croct. The async request API change in Next.js 15 is absorbed inside the SDK.
Two things to check when you jump a Next.js major:
- Update @croct/plug-next to the latest version alongside it, so you get the release that targets the new request APIs.
- If you ever compose your own middleware, keep the withCroct wrapper and the matcher that excludes api, _next/static, and similar asset paths. Since you only export the proxy, you are already covered.
If you started from an older tutorial, note the export was renamed from middleware to proxy a while back, see Do I need to rename the Croct middleware export to proxy? for the details.
Was this helpful?
Still have questions?