TL;DR: on Next.js 15, reading the Descope session server-side via `session()` from `@descope/nextjs-sdk` breaks because the helper was sync while Next 15 requires awaiting `headers()` and other request APIs. Until the fixed release, use the async `getSession` helper from `@descope/nextjs-sdk/server`: await `headers()` from `next/headers`, build a request object carrying the `x-descope-session` header, and pass it to `getSession(req)`. Descope staff posted exactly this pattern. Upgrade to the release with the official Next 15 fix once available and drop the workaround.

## Steps

1. Replace the sync `session()` call with the async pattern:

```js
import { headers } from 'next/headers';
import { getSession } from '@descope/nextjs-sdk/server';

const h = await headers();
const session = await getSession({ headers: { 'x-descope-session': h.get('x-descope-session') } });
```

2. Re-run the server component or route.

   Expected: session data comes back. Success check: server logs stop showing session failures.

## When to use this

- Next.js 15, @descope/nextjs-sdk, server-side session reads empty or throwing.

## When NOT to use this

- Client-side session handling; this is server-only.
- Older Next.js where the sync helper works.

## Compatibility

- @descope/nextjs-sdk on Next.js 15; official fix release pending at thread time.

## Variant phrasings

- "descope nextjs 15 session empty"
- "descope getSession next 15"

## Root cause

Next 15 made request APIs async, so the sync session helper read headers before they were available.

## Edge cases

- Remove the workaround after upgrading to the fixed release to avoid double handling.

Source: https://github.com/descope/descope-js/issues/884