Skip to content

Commit e07af19

Browse files
Add documentation about where to import StringtaleProvider from
1 parent f152e27 commit e07af19

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/content/docs/back-end/next-js-app-router.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Implementation guide for using Stringtale with Next.js when using t
44
---
55

66
import { Tabs, TabItem } from "@astrojs/starlight/components";
7+
import { Aside } from "@astrojs/starlight/components"
78

89
## App router
910

@@ -51,7 +52,11 @@ execute the following steps manually.
5152
_For more information on how to obtain an API key, please refer to the [obtaining an API key](/usage/obtaining-api-key) guide._
5253
4. Add `<StringtaleProvider>` and Stringtale's CSS to your `RootLayout` in `app/layout.tsx` as such:
5354

55+
<Aside type="caution">
56+
**Important:** In order for Server Side rendering to keep working, you must import `StringtaleProvider` from `@stringtale/next` when using the app router.
57+
</Aside>
5458
```tsx
59+
// Make sure this import is from @stringtale/next
5560
import { StringtaleProvider } from "@stringtale/next"
5661
import "@stringtale/react/styles.css"
5762

@@ -70,4 +75,5 @@ execute the following steps manually.
7075
}
7176
```
7277
For more information about RootLayout see the [NextJS documentation](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required).
78+
7379
5. You're now ready to use Stringtale in your project. For more information on how to use Stringtale with React see our [React documentation](/front-end/react).

src/content/docs/back-end/next-js-pages-router.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Implementation guide for using Stringtale with Next.js when using t
44
---
55

66
import { Tabs, TabItem } from "@astrojs/starlight/components";
7+
import { Aside } from "@astrojs/starlight/components"
8+
79

810
## Pages router
911

@@ -49,9 +51,13 @@ execute the following steps manually.
4951
```
5052
_For more information on how to obtain an API key, please refer to the [obtaining an API key](/usage/obtaining-api-key) guide._
5153
4. Update your `App` component in `<PROJECT_DIRECTORY>/pages/_app.tsx` and wrap your app using `<StringtaleProvider>` as follows:
52-
54+
<Aside type="caution">
55+
**Important:** When using the pages router, you must import the `StringtaleProvider` from `@stringtale/react` or certain features such as login will break.
56+
</Aside>
5357
```tsx
5458
import type { AppProps } from 'next/app'
59+
// When using pages router, make sure to import
60+
// from @stringtale/react, not @stringtale/next
5561
import { StringtaleProvider } from "@stringtale/react"
5662
import "@stringtale/react/styles.css"
5763

@@ -64,4 +70,5 @@ execute the following steps manually.
6470
}
6571
```
6672
For more information about customizing the `App` component see the [NextJS documentation](https://nextjs.org/docs/pages/building-your-application/routing/custom-app).
73+
6774
5. You're now ready to use Stringtale in your project. For more information on how to use Stringtale with React see our [React documentation](/front-end/react).

0 commit comments

Comments
 (0)