Skip to content

Commit 0c31cd0

Browse files
maratalclaude
andcommitted
docs: caveat ssr:false approach and link to fundamentals kit
Recommend the ably-nextjs-fundamentals-kit for production Next.js apps instead of dynamic(ssr:false), per Steven Lindsay's review feedback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bf4da9b commit 0c31cd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/docs/push/getting-started/nextjs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ npm install ably
6060

6161
This step initializes the Ably Realtime client with push notification support and wraps the app in `AblyProvider` so that all child components can access the client via hooks.
6262

63-
Because the Ably SDK runs in the browser, the component must not be server-side rendered. Use Next.js [`dynamic`](https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading) with `ssr: false` to ensure the Ably client is only ever created in the browser.
63+
Because the Ably SDK runs in the browser, the component must not be server-side rendered. This guide uses Next.js [`dynamic`](https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading) with `ssr: false` to keep things simple, but this is not the recommended approach for production apps. For a more complete Next.js integration pattern, see the [ably-nextjs-fundamentals-kit](https://github.com/ably/ably-nextjs-fundamentals-kit).
6464

6565
Create `src/app/push/page.tsx` as the entry point:
6666

@@ -78,7 +78,7 @@ export default function PushPage() {
7878
```
7979
</Code>
8080

81-
Then create `src/app/push/PushApp.tsx`. Because this module is only ever loaded client-side (due to `ssr: false`), it is safe to instantiate the Ably client at module scope:
81+
Then create `src/app/push/PushApp.tsx`. Because this module is only ever loaded client-side (due to `ssr: false`), it is safe to instantiate the Ably client at module scope. In a production app you would instead use `useAbly` from within a component to avoid creating a global client instance:
8282

8383
<Code>
8484
```javascript

0 commit comments

Comments
 (0)