---
title: useSSRStatus
description: Check whether server-side rendered consent data was used during initialization.
---
`useSSRStatus()` returns information about whether SSR data was used for consent manager initialization. This is primarily useful for debugging SSR data flow in Next.js or other server-rendering frameworks.

```tsx
import { useSSRStatus } from '@c15t/nextjs';

function DebugSSR() {
  const { ssrDataUsed, ssrSkippedReason } = useSSRStatus();

  if (ssrDataUsed) {
    return <span>Consent initialized from SSR data</span>;
  }

  return <span>SSR skipped: {ssrSkippedReason ?? 'unknown'}</span>;
}
```

## Return Value

| Property         | Type                                                         | Description                                                                                                                                                                                                                                                                                                                          | Default |  Required  |
| :--------------- | :----------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :--------: |
| ssrDataUsed      | boolean                                                      | Whether SSR data was used for initialization.&#xA;&#xA;\`true\` if SSR data was provided and successfully consumed,&#xA;\`false\` otherwise.                                                                                                                                                                                         | -       | ✅ Required |
| ssrSkippedReason | "no\_data" \| "fetch\_failed" \| "context\_mismatch" \| null | Reason SSR data was skipped, or \`null\` if used successfully.&#xA;&#xA;- \`'no\_data'\` — no \`ssrData\` prop was provided to the provider&#xA;- \`'fetch\_failed'\` — \`ssrData\` was provided but the Promise resolved with no data&#xA;- \`'context\_mismatch'\` — \`ssrData\` did not match the current runtime request context | -       | ✅ Required |

> ℹ️ **Info:**
> Must be used within a ConsentManagerProvider. Throws if used outside the provider context.
