Hi! I've been reading the Next.js Pages Router documentation, and am confused about a few things:
app/layout.tsx
; that looks like an App Router thing, not a Pagers Router?Auth
component, but I don't see what that is (or the code for it)?Hi Martin,
Thank you for reaching out with your questions regarding the Next.js Pages Router SDK documentation.
You're correct in noting that the app/layout.tsx
file is associated with the App Router in Next.js, not the Pages Router. The Pages Router SDK utilizes the pages/_app.js
file for global configurations. This discrepancy arises because the Pages Router SDK was developed prior to the introduction of the App Router in Next.js. For optimal integration with Next.js 13 and later versions, we recommend using our dedicated Next.js App Router SDK, which is specifically designed for these versions and offers enhanced compatibility. https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/
Regarding the Auth
component mentioned in the documentation, it serves as a wrapper to manage authentication state across your application. In the Pages Router SDK, this component is typically imported and used within the pages/_app.js
file to ensure that authentication context is available throughout your app. If you're using the App Router, the equivalent setup would involve wrapping your application with the KindeProvider
in the app/layout.tsx
file. This approach ensures that authentication context is properly managed in your application. https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk
If you have further questions or need additional assistance, please don't hesitate to ask. I'm here to help.
For optimal integration with Next.js 13 and later versions, we recommend using our dedicated Next.js App Router SDK,I'm using nextjs 15.1 with pages router
Regarding the Auth component mentioned in the documentation, it serves as a wrapper to manage authentication state across your applicationIs the component documented somewhere, or code available?
Hi Martin
Is this what you mean? https://docs.kinde.com/developer-tools/sdks/backend/nextjs-prev-sdk/#kinde-auth-data
Also, are you having a specific issue connecting, or is this mostly docs feedback?