🚧 Work in Progress: Update Next.js pages router and other Next.js docs#741
🚧 Work in Progress: Update Next.js pages router and other Next.js docs#741tamalchowdhury wants to merge 2 commits into
Conversation
WalkthroughThis PR updates Kinde's Next.js SDK documentation across two main areas: marking the legacy Pages Router SDK as officially deprecated with a completely rewritten guide, and updating the modern App Router SDK's example property key naming. The Pages Router guide is restructured for clarity with deprecation notices, updated quickstart instructions, reorganized auth reference sections, and clarified route protection patterns. The App Router SDK example is updated to reflect the ChangesLegacy Pages Router SDK Deprecation and Rewrite
App Router SDK Property Key Update
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/content/docs/developer-tools/sdks/backend/nextjs-prev-sdk.mdx`:
- Line 256: Replace the user-facing phrase "sign up page" with the hyphenated
form "sign-up page" in the sentence that reads "You will be redirected to the
Kinde hosted sign up page." (look for that exact sentence in the Next.js SDK
docs content).
- Line 53: The sentence "If you are using Next.js 13 or earlier, refer to the
earlier version [Next.js Pages Router
v1](/developer-tools/sdks/backend/nextjs-prev-sdkv1/)." incorrectly redirects
Next.js 13 users to v1; change the wording to target the true legacy cutoff
(e.g., "If you are using Next.js 12 or earlier" or "If you are using the Pages
Router (Next.js 12 or earlier)"), update the link/display text referencing
"Next.js Pages Router v1" and the URL
"/developer-tools/sdks/backend/nextjs-prev-sdkv1/" accordingly, or alternatively
add a short clarifier that distinguishes the App Router (Next.js 13+) from the
Pages Router so readers know which page to follow.
- Around line 768-772: In the env code block containing the KINDE_DEBUG_MODE
example, replace the invalid JavaScript-style comment "// .env" with a valid
dotenv comment "# .env" (or remove the comment line entirely) so the snippet
uses correct .env syntax; update the triple-backtick block that starts with
```env and the line containing "// .env" accordingly.
In `@src/content/docs/developer-tools/sdks/backend/nextjs-sdk.mdx`:
- Around line 603-611: The getUser return example still uses legacy keys like
"usr_*"; update that example to use the new "kp_usr_*" prefix so it matches the
rest of the document—locate the client-side user/getUser example (the JSON
object under the getUser return example around the user example block) and
rename every occurrence of keys starting with "usr_" (e.g., usr_city,
usr_industry, usr_job_title, usr_middle_name, usr_postcode, usr_salutation,
usr_state_region, usr_street_address, usr_street_address_2) to use the "kp_usr_"
prefix (kp_usr_city, kp_usr_industry, etc.) ensuring all examples on the page
are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 03d05e8b-bbda-4452-982e-f08f39e2a7b2
📒 Files selected for processing (3)
src/content/docs/developer-tools/sdks/backend/nextjs-prev-sdk.mdxsrc/content/docs/developer-tools/sdks/backend/nextjs-prev-sdkv1.mdxsrc/content/docs/developer-tools/sdks/backend/nextjs-sdk.mdx
| <Aside> | ||
| You are viewing the docs for Next.js **Pages Router**. If you are using the latest App Router, please refer to the [Next.js App Router](/developer-tools/sdks/backend/nextjs-sdk/) docs instead. | ||
|
|
||
| If you are using Next.js 13 or earlier, refer to the earlier version [Next.js Pages Router v1](/developer-tools/sdks/backend/nextjs-prev-sdkv1/). |
There was a problem hiding this comment.
Fix conflicting version guidance for Next.js 13 users.
This line currently redirects all Next.js 13 users to the v1 page, which conflicts with this guide’s own targeting and can misroute readers to older instructions. Narrow this to the actual legacy cutoff (for example, Next.js 12 or earlier) or clarify the exact router/version split.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/developer-tools/sdks/backend/nextjs-prev-sdk.mdx` at line
53, The sentence "If you are using Next.js 13 or earlier, refer to the earlier
version [Next.js Pages Router
v1](/developer-tools/sdks/backend/nextjs-prev-sdkv1/)." incorrectly redirects
Next.js 13 users to v1; change the wording to target the true legacy cutoff
(e.g., "If you are using Next.js 12 or earlier" or "If you are using the Pages
Router (Next.js 12 or earlier)"), update the link/display text referencing
"Next.js Pages Router v1" and the URL
"/developer-tools/sdks/backend/nextjs-prev-sdkv1/" accordingly, or alternatively
add a short clarifier that distinguishes the App Router (Next.js 13+) from the
Pages Router so readers know which page to follow.
| npm run dev | ||
| ``` | ||
|
|
||
| 2. Navigate to `http://localhost:3000` and select **Create account**. You will be redirected to the Kinde hosted sign up page. |
There was a problem hiding this comment.
Hyphenate “sign-up” in user-facing text.
Use “sign-up page” (compound adjective) for correctness and consistency.
🧰 Tools
🪛 LanguageTool
[grammar] ~256-~256: Use a hyphen to join words.
Context: ...t**. You will be redirected to the Kinde hosted sign up page. 3. Sign up with a...
(QB_NEW_EN_HYPHEN)
[grammar] ~256-~256: Use a hyphen to join words.
Context: ...l be redirected to the Kinde hosted sign up page. 3. Sign up with a test user a...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/developer-tools/sdks/backend/nextjs-prev-sdk.mdx` at line
256, Replace the user-facing phrase "sign up page" with the hyphenated form
"sign-up page" in the sentence that reads "You will be redirected to the Kinde
hosted sign up page." (look for that exact sentence in the Next.js SDK docs
content).
| ```env | ||
| // .env | ||
|
|
||
| KINDE_DEBUG_MODE = true; | ||
| KINDE_DEBUG_MODE=true | ||
| ``` |
There was a problem hiding this comment.
Use valid .env comment syntax in the debug-mode snippet.
// .env inside an env block is misleading for dotenv files. Replace it with # .env or remove the comment line.
Suggested doc fix
```env
-// .env
+# .env
KINDE_DEBUG_MODE=true</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @src/content/docs/developer-tools/sdks/backend/nextjs-prev-sdk.mdx around
lines 768 - 772, In the env code block containing the KINDE_DEBUG_MODE example,
replace the invalid JavaScript-style comment "// .env" with a valid dotenv
comment "# .env" (or remove the comment line entirely) so the snippet uses
correct .env syntax; update the triple-backtick block that starts with ```env
and the line containing "// .env" accordingly.
</details>
<!-- fingerprinting:phantom:poseidon:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
| "kp_usr_city": "", | ||
| "kp_usr_industry": "", | ||
| "kp_usr_job_title": "", | ||
| "kp_usr_middle_name": "", | ||
| "kp_usr_postcode": "", | ||
| "kp_usr_salutation": "", | ||
| "kp_usr_state_region": "", | ||
| "kp_usr_street_address": "", | ||
| "kp_usr_street_address_2": "" |
There was a problem hiding this comment.
Complete the prefix rename across all user property examples in this doc.
Good update here to kp_usr_*, but the client-side user / getUser return example still shows usr_* keys (Line 1129-Line 1137), which conflicts with this section and other token examples on the same page. Please align those keys to kp_usr_* as well to avoid mixed guidance.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/developer-tools/sdks/backend/nextjs-sdk.mdx` around lines
603 - 611, The getUser return example still uses legacy keys like "usr_*";
update that example to use the new "kp_usr_*" prefix so it matches the rest of
the document—locate the client-side user/getUser example (the JSON object under
the getUser return example around the user example block) and rename every
occurrence of keys starting with "usr_" (e.g., usr_city, usr_industry,
usr_job_title, usr_middle_name, usr_postcode, usr_salutation, usr_state_region,
usr_street_address, usr_street_address_2) to use the "kp_usr_" prefix
(kp_usr_city, kp_usr_industry, etc.) ensuring all examples on the page are
consistent.
This PR makes updates and improvements to the existing Next.js pages router and other legacy Nextjs pages.
Description (required)
Related issues & labels (optional)
Summary by CodeRabbit
Documentation