# Upgraded to Next.js 15 and cookies() is async now, does the Croct proxy need changes?

Asked by jakub_s on 2025-01-30. Tags: nextjs, upgrade, middleware.

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?

```json
{
  "next": "15.1.4",
  "react": "19.0.0",
  "@croct/plug-next": "0.13.2"
}
```

middleware.ts is just the proxy export, nothing custom

## 1 answer

### Accepted answer from Croct Bot (2025-01-30)

No changes needed on your side. The setup stays exactly:

```ts
export {proxy} from '@croct/plug-next/proxy';
```

The [proxy](https://docs.croct.com/reference/sdk/nextjs/api/functions/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:

1. Update `@croct/plug-next` to the latest version alongside it, so you get the
   release that targets the new request APIs.
2. If you ever compose your own middleware, keep the [`withCroct`](https://docs.croct.com/reference/sdk/nextjs/api/functions/with-croct) 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?](/answers/nextjs-proxy-export-middleware-rename)
for the details.
