Skip to content

Conversation

@madster456
Copy link
Collaborator

@madster456 madster456 commented Jan 12, 2026

Summary

This PR improves the documentation for GitHub authentication setup and self-hosting.

Changes

GitHub OAuth/App Setup Guide

  • Updated github.mdx with clearer instructions differentiating between GitHub OAuth App and GitHub App setup
  • Added better explanations for when to use each option

Self-Hosting Documentation

  • Added prominent danger warning about self-hosting responsibilities
  • Migrated inline shell commands to structured code examples using PlatformCodeblock component
  • Created docs/code-examples/self-host.ts with all self-hosting commands

Info Component

  • Added new danger type for critical warnings with red accent styling
  • Updated component styling with modern left accent bar and gradient backgrounds

PlatformCodeblock Component

  • Added hidePlatformSelector prop to hide platform dropdown for single-platform code examples
  • Added Shell platform support for terminal commands (Docker, Git, pnpm)
  • Filtered Shell platform from user-selectable options in both the codeblock and header selectors

Platform Config

  • Added Shell platform with Docker, Git, and pnpm frameworks

Summary by CodeRabbit

  • New Features

    • Added comprehensive self-hosting and authentication customization example collections for copy-paste use.
    • New "danger" info style with visual accent for important warnings.
  • Documentation

    • GitHub integration guide now centers on GitHub App with an alternate OAuth path retained.
    • Replaced many inline snippets with platform-driven code blocks and improved platform/framework selector behavior (single-platform optimization; option to hide selector).
    • Pages now surface "Last updated" above descriptions.

✏️ Tip: You can customize this high-level summary in your review settings.

@cmux-agent
Copy link

cmux-agent bot commented Jan 12, 2026

Older cmux preview screenshots (latest comment is below)

Preview Screenshots

Open Diff Heatmap

Preview screenshots are being captured...

Workspace and dev browser links will appear here once the preview environment is ready.


Generated by cmux preview system

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
stack-backend Ready Ready Preview, Comment Jan 14, 2026 2:41pm
stack-dashboard Ready Ready Preview, Comment Jan 14, 2026 2:41pm
stack-demo Ready Ready Preview, Comment Jan 14, 2026 2:41pm
stack-docs Ready Ready Preview, Comment Jan 14, 2026 2:41pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Warning

Rate limit exceeded

@madster456 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e26321c and 2cea456.

📒 Files selected for processing (3)
  • docs/code-examples/self-host.ts
  • docs/content/docs/(guides)/concepts/auth-providers/github.mdx
  • docs/src/components/mdx/platform-codeblock.tsx

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds Shell platform and self-hosting code examples, replaces inline shell snippets with PlatformCodeblock usage across docs, updates GitHub guide to prefer GitHub App, enhances Info component with a danger variant, and surfaces page last-modified near the top.

Changes

Cohort / File(s) Summary
Self-hosting Code Examples
docs/code-examples/self-host.ts, docs/code-examples/index.ts
New selfHostExamples export with grouped CodeExample arrays (docker-postgres, docker-run, git-clone, local-dev-setup, prisma-studio, backend-build, dashboard-build, db-init); index.ts imports and registers customizationExamples and selfHostExamples under new registry keys.
Platform configuration & selection UI
docs/lib/platform-config.ts, docs/src/components/layouts/platform-indicator.tsx, docs/src/components/mdx/platform-codeblock.tsx
Adds Shell to PlatformName and PLATFORMS; PlatformIndicator filters out Shell from visible options; PlatformCodeblock adds hidePlatformSelector?: boolean, filters platforms (hides Shell), reworks platform/framework dropdown flows and selection defaults.
Info component
docs/src/components/mdx/info.tsx
Extends InfoProps.type to include danger; adds danger colorVariant and icon; renders left accent bar for info blocks and supports danger icon.
Documentation pages & examples
docs/content/docs/(guides)/others/self-host.mdx, docs/content/docs/(guides)/customization/page-examples/*, docs/content/docs/(guides)/concepts/auth-providers/github.mdx
Replaces many inline shell/TSX blocks with PlatformCodeblock references (self-host and customization examples); updates GitHub provider guide to focus on GitHub App with an accordion preserving OAuth App steps; adds lastModified metadata to examples pages and moves last-updated render to top of docs pages.
App page rendering
docs/src/app/docs/[[...slug]]/page.tsx
Adds formatDate helper and moves "Last updated" display above the description; minor header spacing adjustment.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Page as Docs Page
  participant Indicator as PlatformIndicator
  participant CodeBlock as PlatformCodeblock
  participant Registry as Examples Registry

  User->>Page: open doc with PlatformCodeblock
  Page->>Registry: request examples (docId, exampleKey)
  Registry-->>Page: return example variants (including Shell)
  Page->>Indicator: render available platforms (PLATFORMS filtered)
  Indicator-->>User: show platform selector (Shell omitted)
  User->>Indicator: select platform/framework
  Indicator->>CodeBlock: update selected platform/framework
  CodeBlock->>Page: render code for selection (may hide selector if hidePlatformSelector)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • N2D4

Poem

🐰 Hops of code and shell so bright,
New examples spring into the light,
Danger flags in crimson show,
Platforms pruned so users know,
Docs hop forward—soft and light.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title covers multiple significant changes including GitHub authentication setup, UI changes, and platform selection, but it is quite broad and doesn't clearly highlight the primary focus.
Description check ✅ Passed The description provides a well-organized summary with clear sections covering GitHub setup, self-hosting, info component, platform codeblock, and platform config changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 12, 2026

Greptile Overview

Greptile Summary

This PR enhances the Stack Auth documentation by improving GitHub authentication setup instructions and self-hosting documentation. Key changes include:

GitHub OAuth Documentation: Updated github.mdx to clearly differentiate between GitHub App and GitHub OAuth App setup, with the primary instructions focusing on GitHub App (the recommended approach) and OAuth App instructions moved to an accordion. Both installation paths are now clearly documented with step-by-step instructions.

Self-Hosting Improvements: Added a prominent danger warning about self-hosting responsibilities and migrated inline shell commands to structured code examples. The commands are now organized using the new PlatformCodeblock component with the hidePlatformSelector prop, providing a cleaner and more consistent documentation experience.

Component Enhancements:

  • Added danger type to the Info component with red accent styling and updated all info types to use modern gradient backgrounds with left accent bars
  • Extended PlatformCodeblock with hidePlatformSelector prop to hide the platform selector for single-platform examples
  • Added Shell platform support to the platform configuration system with Docker, Git, and pnpm frameworks
  • Filtered Shell platform from user-selectable options in both the codeblock dropdown and header platform selector, as it's only used internally for terminal commands

The PR maintains backward compatibility while improving documentation clarity and visual consistency.

Confidence Score: 4/5

  • Generally safe to merge with minor fixes needed for broken commands and markdown syntax
  • The PR contains two bugs: (1) incorrect directory name in git clone command that will cause command failure, and (2) invalid markdown syntax for horizontal rule. These are both straightforward documentation errors that users will encounter. The code changes themselves are well-implemented with proper type safety, filtering logic, and backward compatibility.
  • docs/code-examples/self-host.ts (incorrect directory name), docs/content/docs/(guides)/concepts/auth-providers/github.mdx (invalid markdown syntax)

Important Files Changed

File Analysis

Filename Score Overview
docs/code-examples/index.ts 5/5 Added selfHostExamples import and registration - straightforward addition with no issues
docs/code-examples/self-host.ts 3/5 New file containing Shell platform code examples for self-hosting - contains typo in git-clone directory that will cause command failure
docs/content/docs/(guides)/concepts/auth-providers/github.mdx 3/5 Updated GitHub OAuth setup guide with GitHub App vs OAuth App distinction - contains invalid markdown separator syntax
docs/content/docs/(guides)/others/self-host.mdx 5/5 Updated self-hosting docs with danger warning and PlatformCodeblock components - clean changes, no issues found
docs/lib/platform-config.ts 5/5 Added Shell platform with Docker, Git, pnpm frameworks - clean type-safe addition, no issues
docs/src/components/layouts/platform-indicator.tsx 5/5 Added filter to exclude Shell platform from user selection - properly implemented filtering logic, no issues
docs/src/components/mdx/info.tsx 5/5 Added danger type for critical warnings with updated styling using gradients - clean implementation, no issues
docs/src/components/mdx/platform-codeblock.tsx 5/5 Added hidePlatformSelector prop and Shell platform filtering - well-implemented new feature with proper fallback handling

Sequence Diagram

sequenceDiagram
    participant User
    participant MDX as MDX Documentation
    participant PC as PlatformCodeblock
    participant PI as PlatformIndicator
    participant SC as SelfHostExamples
    participant Info as Info Component

    User->>MDX: Views self-host.mdx
    MDX->>Info: Render danger warning
    Info-->>User: Display red accent warning
    
    MDX->>PC: Request code example (hidePlatformSelector=true)
    PC->>SC: getExample("others/self-host", "git-clone")
    SC-->>PC: Return Shell/Git example
    PC->>PC: Filter platformNames (exclude Shell)
    PC->>PC: Check hidePlatformSelector || single platform
    PC-->>User: Display code without selector
    
    User->>PI: Click platform selector in header
    PI->>PI: Filter PLATFORMS (exclude Shell)
    PI-->>User: Show JavaScript/Python only
    
    User->>PI: Select platform/framework
    PI->>PI: Broadcast via CustomEvent
    PI->>PI: Update sessionStorage
    PC->>PC: Listen to stack-platform-change
    PC->>PC: Update selected platform
    PC-->>User: Display updated code examples
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/lib/platform-config.ts (1)

48-50: Consider removing getAllPlatformNames() or adding a filter parameter if it's intended for external use.

The function is currently unused in the codebase. Shell filtering is already properly implemented at the places where platforms are actually used (platform-codeblock.tsx and platform-indicator.tsx both explicitly filter Shell). However, getAllPlatformNames() returns all platforms including Shell without any way to exclude it. If this is dead code, remove it; if it's intended for external consumption, either exclude Shell by default or add a parameter to control its inclusion.

🤖 Fix all issues with AI agents
In @docs/code-examples/self-host.ts:
- Around line 25-34: The code example in the 'git-clone' entry of the
CodeExample array uses the wrong directory name after cloning; update the code
string in that object (the entry keyed 'git-clone') so the second line reads "cd
stack-auth" instead of "cd stack" to match the cloned repo name.

In @docs/content/docs/(guides)/concepts/auth-providers/github.mdx:
- Line 47: Update the heading string "Create a OAuth App" to use the correct
article and casing: change it to "Create an OAuth App" in the docs file so it
reads with the correct grammar and standard "OAuth" capitalization (look for the
heading text "Create a OAuth App" in the markdown).
- Line 5: Update the phrase "Stack Auth enabled application" to the hyphenated
compound adjective "Stack Auth-enabled application" in the sentence describing
GitHub sign-in; locate the sentence starting "This guide explains how to set up
GitHub as an authentication provider..." and replace the phrase accordingly to
use the hyphenated form.
- Around line 43-44: Replace the typoged horizontal rule and fix the
capitalization in the Accordion title: change the stray `-- -` to a proper `---`
horizontal rule and update the Accordion title string from "Github OAuth App
installation" to "GitHub OAuth App installation" (look for the Accordion
component with title="Github OAuth App installation" and correct both the rule
and the brand capitalization).

In @docs/src/components/mdx/platform-codeblock.tsx:
- Around line 267-271: The early return checks platformNames.length === 0 which
bails out when all examples are Shell-only; instead base the "no platforms"
check on allPlatformNames (or allow rendering when firstPlatform is defined even
if platformNames is empty). Update the logic around platformNames,
allPlatformNames and firstPlatform so that if allPlatformNames has entries
(e.g., only "Shell") the component proceeds to render using firstPlatform
(fallback to allPlatformNames[0]) rather than returning "No platforms
configured".
🧹 Nitpick comments (2)
docs/src/components/mdx/info.tsx (1)

85-89: The danger icon is identical to the warning icon.

Both the danger and warning types use the same SVG path (triangle with exclamation mark). Consider using a distinct icon for danger (e.g., a stop sign, X in circle, or shield with exclamation) to help users visually differentiate between warnings and critical danger messages.

docs/src/components/layouts/platform-indicator.tsx (1)

40-42: Silent catch block may hide parsing errors.

While ignoring parsing errors for session storage is reasonable for resilience, the empty catch block could benefit from a brief inline comment explaining why errors are intentionally ignored, or you could log at debug level for troubleshooting.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20f435f and f995d9c.

📒 Files selected for processing (8)
  • docs/code-examples/index.ts
  • docs/code-examples/self-host.ts
  • docs/content/docs/(guides)/concepts/auth-providers/github.mdx
  • docs/content/docs/(guides)/others/self-host.mdx
  • docs/lib/platform-config.ts
  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/info.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

For blocking alerts and errors, never use toast; instead, use alerts as toasts are easily missed by the user

Files:

  • docs/lib/platform-config.ts
  • docs/code-examples/self-host.ts
  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
  • docs/code-examples/index.ts
  • docs/src/components/mdx/info.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

NEVER use Next.js dynamic functions if avoidable; prefer using client components instead to keep pages static (e.g., use usePathname instead of await params)

Files:

  • docs/lib/platform-config.ts
  • docs/code-examples/self-host.ts
  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
  • docs/code-examples/index.ts
  • docs/src/components/mdx/info.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: NEVER try-catch-all, NEVER void a promise, and NEVER use .catch(console.error) or similar; use loading indicators instead; if asynchronous handling is necessary, use runAsynchronously or runAsynchronouslyWithAlert instead
Use ES6 maps instead of records wherever possible

Files:

  • docs/lib/platform-config.ts
  • docs/code-examples/self-host.ts
  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
  • docs/code-examples/index.ts
  • docs/src/components/mdx/info.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Code defensively; prefer ?? throwErr(...) over non-null assertions with good error messages explicitly stating violated assumptions
Avoid the any type; when necessary, leave a comment explaining why it's used, why the type system fails, and how errors would be caught at compile-, test-, or runtime

Files:

  • docs/lib/platform-config.ts
  • docs/code-examples/self-host.ts
  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
  • docs/code-examples/index.ts
  • docs/src/components/mdx/info.tsx
**/*.{tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{tsx,css}: Keep hover/click animations snappy and fast; don't delay actions with pre-transitions (e.g., no fade-in on button hover) as it makes UI feel sluggish; instead apply transitions after the action like smooth fade-out when hover ends
When creating hover transitions, avoid hover-enter transitions and use only hover-exit transitions (e.g., transition-colors hover:transition-none)

Files:

  • docs/src/components/layouts/platform-indicator.tsx
  • docs/src/components/mdx/platform-codeblock.tsx
  • docs/src/components/mdx/info.tsx
🧠 Learnings (2)
📚 Learning: 2026-01-07T00:55:19.871Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-07T00:55:19.871Z
Learning: Applies to {packages/stack,packages/js}/**/*.{ts,tsx,js,jsx} : NEVER UPDATE packages/stack OR packages/js; instead, update packages/template as those packages are copies of it

Applied to files:

  • docs/content/docs/(guides)/others/self-host.mdx
📚 Learning: 2026-01-07T00:55:19.871Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-07T00:55:19.871Z
Learning: The project uses Next.js with App Router framework for the backend, dashboard, and dev-launchpad apps

Applied to files:

  • docs/content/docs/(guides)/others/self-host.mdx
🧬 Code graph analysis (3)
docs/code-examples/self-host.ts (1)
docs/lib/code-examples.ts (1)
  • CodeExample (15-23)
docs/src/components/layouts/platform-indicator.tsx (1)
docs/lib/platform-config.ts (1)
  • PLATFORMS (21-37)
docs/src/components/mdx/platform-codeblock.tsx (1)
docs/src/components/icons.tsx (1)
  • ChevronDown (67-69)
🪛 LanguageTool
docs/content/docs/(guides)/concepts/auth-providers/github.mdx

[grammar] ~5-~5: Use a hyphen to join words.
Context: ...lows users to sign in to your Stack Auth enabled application using their GitHub a...

(QB_NEW_EN_HYPHEN)

docs/content/docs/(guides)/others/self-host.mdx

[style] ~42-~42: Consider a more concise word here.
Context: ...also supply a STACK_FREESTYLE_API_KEY in order to send emails with Stack Auth (can be gen...

(IN_ORDER_TO_PREMIUM)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: restart-dev-and-test-with-custom-base-port
  • GitHub Check: all-good
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: check_prisma_migrations (22.x)
  • GitHub Check: E2E Tests (Node 22.x, Freestyle mock)
  • GitHub Check: build (22.x)
  • GitHub Check: E2E Tests (Node 22.x, Freestyle prod)
  • GitHub Check: setup-tests
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: restart-dev-and-test
  • GitHub Check: setup-tests-with-custom-base-port
🔇 Additional comments (11)
docs/src/components/mdx/info.tsx (2)

32-37: LGTM: Danger variant styling is well-defined.

The color scheme for the danger variant uses appropriate red tones with proper light/dark mode support. The gradient styling is consistent with other variants.


63-67: Nice addition: Left accent bar enhances visual hierarchy.

The left accent bar provides a clear visual indicator for the info type, improving scannability of documentation.

docs/content/docs/(guides)/concepts/auth-providers/github.mdx (1)

14-17: LGTM: Clear guidance on GitHub App vs OAuth App.

The info block provides helpful context for users deciding between the two authentication options, with a link to GitHub's official documentation.

docs/src/components/layouts/platform-indicator.tsx (1)

166-167: LGTM: Shell platform correctly filtered from user-facing selector.

The filter ensures Shell platform (used internally for terminal commands) is not exposed in the user-selectable dropdown. The inline comment clearly explains the rationale.

docs/code-examples/index.ts (1)

4-4: LGTM: Self-host examples integrated correctly.

The import and registry addition follow the established pattern for code examples. The 'others' section key aligns with the document path structure.

Also applies to: 12-12

docs/lib/platform-config.ts (1)

32-36: LGTM: Shell platform configuration is well-structured.

The Shell platform with Docker, Git, and pnpm frameworks is correctly added to the platform configuration. The internal-only usage pattern (filtered from UI selectors) is properly implemented in consuming components.

docs/code-examples/self-host.ts (1)

1-106: Well-structured code examples file.

The examples follow the CodeExample type contract correctly and provide clear, organized shell commands for all self-hosting scenarios.

docs/content/docs/(guides)/others/self-host.mdx (2)

6-8: Good use of danger Info component for critical warning.

The prominent warning about self-hosting responsibilities is appropriate and helps set user expectations upfront.


39-46: Consistent use of PlatformCodeblock for shell examples.

The migration from inline code to PlatformCodeblock components with hidePlatformSelector provides a cleaner, more maintainable approach for shell command documentation.

docs/src/components/mdx/platform-codeblock.tsx (2)

127-131: Clean prop addition with appropriate JSDoc.

The hidePlatformSelector prop is well-documented and the default value of false maintains backward compatibility.

Also applies to: 247-248


552-640: Well-structured dropdown rendering logic.

The conditional rendering based on hidePlatformSelector and the single-platform optimization (platformNames.length === 1 && currentFrameworks.length === 1) are sensible improvements. The two-step platform/framework selection UI with back navigation is intuitive.

@cmux-agent
Copy link

cmux-agent bot commented Jan 12, 2026

Preview Screenshots

Open Diff Heatmap

Preview screenshots are being captured...

Workspace and dev browser links will appear here once the preview environment is ready.


Generated by cmux preview system

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/content/docs/(guides)/customization/page-examples/sign-up.mdx (1)

39-39: Broken link: inconsistent path spelling.

This link uses signin (no hyphen) while line 28 uses sign-in (hyphenated). Given the file naming convention uses hyphens (e.g., sign-up.mdx), this link is likely broken.

🔗 Proposed fix
-Magic link sign-in and sign-up shares the same function. Check out the [Sign In example](/customization/page-examples/signin#custom-magic-link-sign-in) for more information.
+Magic link sign-in and sign-up shares the same function. Check out the [Sign In example](/customization/page-examples/sign-in#custom-magic-link-sign-in) for more information.
🤖 Fix all issues with AI agents
In @docs/content/docs/(guides)/concepts/auth-providers/github.mdx:
- Around line 15-18: Replace incorrect capitalization of the brand name in the
Info block: change any instance of "Github" (e.g., "Github OAuth App") to the
correct "GitHub" so the text reads consistently (e.g., "GitHub OAuth App");
update all occurrences in the shown Info block and any nearby lines to use
"GitHub".
- Around line 45-48: Update the accordion section title and step heading to
correct capitalization and grammar: change the Accordion title string from
"Github OAuth App installation" to "GitHub OAuth App installation" and change
the Step heading text from "Create a OAuth App" to "Create an OAuth App" (locate
the strings in the Accordion/Step components shown in the diff).
🧹 Nitpick comments (2)
docs/src/app/docs/[[...slug]]/page.tsx (1)

27-37: Add input validation for defensive coding.

If dateString doesn't match the expected "YYYY-MM-DD" format (e.g., malformed frontmatter), this will silently produce garbage output like "undefined NaNth, NaN" rather than failing clearly.

Per coding guidelines on defensive coding, consider validating the format:

Suggested defensive implementation
 function formatDate(dateString: string): string {
   // Parse date parts directly to avoid timezone issues
   // (new Date("2026-01-12") is interpreted as UTC, which can shift the day in local time)
-  const [year, month, day] = dateString.split('-').map(Number);
+  const parts = dateString.split('-').map(Number);
+  if (parts.length !== 3 || parts.some(isNaN)) {
+    console.warn(`Invalid date format: "${dateString}", expected "YYYY-MM-DD"`);
+    return dateString; // Fallback to raw string
+  }
+  const [year, month, day] = parts;
   const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+  if (month < 1 || month > 12) {
+    return dateString;
+  }
   const suffix = day === 1 || day === 21 || day === 31 ? 'st'
     : day === 2 || day === 22 ? 'nd'
       : day === 3 || day === 23 ? 'rd'
         : 'th';
   return `${months[month - 1]} ${day}${suffix}, ${year}`;
 }
docs/code-examples/customization.ts (1)

78-86: Consider awaiting the async onSubmit call in form handlers.

The form submission pattern onSubmit={(e) => { e.preventDefault(); onSubmit(); }} doesn't await the async function, effectively voiding the returned promise. While these are documentation examples, users will copy this pattern. Consider using an async arrow function for better practice:

✨ Suggested pattern for form handlers
-      <form onSubmit={(e) => { e.preventDefault(); onSubmit(); } }>
+      <form onSubmit={async (e) => { e.preventDefault(); await onSubmit(); }}>

This pattern should be applied consistently in lines 80, 127, and 194.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f995d9c and e26321c.

📒 Files selected for processing (7)
  • docs/code-examples/customization.ts
  • docs/code-examples/index.ts
  • docs/content/docs/(guides)/concepts/auth-providers/github.mdx
  • docs/content/docs/(guides)/customization/page-examples/sign-in.mdx
  • docs/content/docs/(guides)/customization/page-examples/sign-up.mdx
  • docs/content/docs/(guides)/others/self-host.mdx
  • docs/src/app/docs/[[...slug]]/page.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

For blocking alerts and errors, never use toast; instead, use alerts as toasts are easily missed by the user

Files:

  • docs/src/app/docs/[[...slug]]/page.tsx
  • docs/code-examples/index.ts
  • docs/code-examples/customization.ts
**/*.{tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{tsx,css}: Keep hover/click animations snappy and fast; don't delay actions with pre-transitions (e.g., no fade-in on button hover) as it makes UI feel sluggish; instead apply transitions after the action like smooth fade-out when hover ends
When creating hover transitions, avoid hover-enter transitions and use only hover-exit transitions (e.g., transition-colors hover:transition-none)

Files:

  • docs/src/app/docs/[[...slug]]/page.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

NEVER use Next.js dynamic functions if avoidable; prefer using client components instead to keep pages static (e.g., use usePathname instead of await params)

Files:

  • docs/src/app/docs/[[...slug]]/page.tsx
  • docs/code-examples/index.ts
  • docs/code-examples/customization.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: NEVER try-catch-all, NEVER void a promise, and NEVER use .catch(console.error) or similar; use loading indicators instead; if asynchronous handling is necessary, use runAsynchronously or runAsynchronouslyWithAlert instead
Use ES6 maps instead of records wherever possible

Files:

  • docs/src/app/docs/[[...slug]]/page.tsx
  • docs/code-examples/index.ts
  • docs/code-examples/customization.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Code defensively; prefer ?? throwErr(...) over non-null assertions with good error messages explicitly stating violated assumptions
Avoid the any type; when necessary, leave a comment explaining why it's used, why the type system fails, and how errors would be caught at compile-, test-, or runtime

Files:

  • docs/src/app/docs/[[...slug]]/page.tsx
  • docs/code-examples/index.ts
  • docs/code-examples/customization.ts
🧠 Learnings (3)
📚 Learning: 2026-01-07T00:55:19.871Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-07T00:55:19.871Z
Learning: Applies to {packages/stack,packages/js}/**/*.{ts,tsx,js,jsx} : NEVER UPDATE packages/stack OR packages/js; instead, update packages/template as those packages are copies of it

Applied to files:

  • docs/content/docs/(guides)/others/self-host.mdx
📚 Learning: 2026-01-07T00:55:19.871Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-07T00:55:19.871Z
Learning: The project uses Next.js with App Router framework for the backend, dashboard, and dev-launchpad apps

Applied to files:

  • docs/content/docs/(guides)/others/self-host.mdx
📚 Learning: 2025-12-03T07:19:44.433Z
Learnt from: madster456
Repo: stack-auth/stack-auth PR: 1040
File: packages/stack-shared/src/interface/crud/oauth-providers.ts:62-87
Timestamp: 2025-12-03T07:19:44.433Z
Learning: In packages/stack-shared/src/interface/crud/oauth-providers.ts and similar CRUD files, the tag "Oauth" (not "OAuth") is the correct capitalization format as it's used by the documentation generation system and follows OpenAPI conventions.

Applied to files:

  • docs/content/docs/(guides)/concepts/auth-providers/github.mdx
🧬 Code graph analysis (2)
docs/code-examples/index.ts (3)
docs/lib/code-examples.ts (1)
  • CodeExample (15-23)
docs/code-examples/self-host.ts (1)
  • selfHostExamples (3-106)
docs/code-examples/customization.ts (1)
  • customizationExamples (3-207)
docs/code-examples/customization.ts (1)
docs/lib/code-examples.ts (1)
  • CodeExample (15-23)
🪛 LanguageTool
docs/content/docs/(guides)/others/self-host.mdx

[style] ~42-~42: Consider a more concise word here.
Context: ...also supply a STACK_FREESTYLE_API_KEY in order to send emails with Stack Auth (can be gen...

(IN_ORDER_TO_PREMIUM)

docs/content/docs/(guides)/customization/page-examples/sign-in.mdx

[grammar] ~34-~34: Use a hyphen to join words.
Context: ...m-oauth"]} /> ## Custom Credential Sign In <PlatformCodeblock document="cust...

(QB_NEW_EN_HYPHEN)

docs/content/docs/(guides)/concepts/auth-providers/github.mdx

[grammar] ~6-~6: Use a hyphen to join words.
Context: ...lows users to sign in to your Stack Auth enabled application using their GitHub a...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: restart-dev-and-test
  • GitHub Check: build (22.x)
  • GitHub Check: setup-tests-with-custom-base-port
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: E2E Tests (Node 22.x, Freestyle prod)
  • GitHub Check: restart-dev-and-test-with-custom-base-port
  • GitHub Check: docker
  • GitHub Check: E2E Tests (Node 22.x, Freestyle mock)
  • GitHub Check: all-good
  • GitHub Check: build (22.x)
  • GitHub Check: check_prisma_migrations (22.x)
  • GitHub Check: setup-tests
🔇 Additional comments (10)
docs/content/docs/(guides)/customization/page-examples/sign-up.mdx (3)

1-4: LGTM!

The lastModified metadata follows the expected ISO 8601 date format.


11-14: LGTM!

The migration to PlatformCodeblock with centralized code examples improves maintainability and consistency across documentation.


32-35: LGTM!

The PlatformCodeblock usage for the custom credential example is consistent with the pattern established above.

docs/src/app/docs/[[...slug]]/page.tsx (1)

70-74: LGTM!

Good conditional rendering and appropriate muted styling for the metadata. The placement between title and description provides clear visual hierarchy.

docs/content/docs/(guides)/customization/page-examples/sign-in.mdx (1)

10-46: LGTM! Clean migration to PlatformCodeblock components.

The refactoring from inline code blocks to PlatformCodeblock components is well-structured. The document path (customization/sign-in) and example names (default, custom-oauth, custom-credential, custom-magic-link) align correctly with the new customizationExamples structure in docs/code-examples/customization.ts.

docs/content/docs/(guides)/others/self-host.mdx (2)

6-8: Good addition of the danger warning.

The prominent danger block effectively communicates self-hosting responsibilities upfront, which is important for setting user expectations before they proceed with the setup.


40-115: Consistent use of PlatformCodeblock with hidePlatformSelector.

The migration to PlatformCodeblock components with hidePlatformSelector is appropriate for shell-only examples where platform selection isn't needed. The document paths and example names correctly reference the selfHostExamples structure.

docs/code-examples/customization.ts (1)

1-207: Well-structured code examples conforming to CodeExample type.

The examples are well-organized by section (sign-in, sign-up) and variant, with consistent structure including language, framework, code, highlightLanguage, and filename fields. The 'use client' directive is correctly included for client components using hooks.

docs/code-examples/index.ts (1)

3-14: LGTM! Registry correctly extended with new example collections.

The new imports and entries correctly integrate selfHostExamples under the 'others' section and customizationExamples under 'customization'. The nested structure aligns with how getExample() parses document paths (e.g., "others/self-host"allExamples['others']['self-host']).

docs/content/docs/(guides)/concepts/auth-providers/github.mdx (1)

21-42: Good restructuring to prioritize GitHub App flow.

The updated documentation correctly prioritizes GitHub App over OAuth App, with clear step-by-step instructions including the important note about minimum permissions (Email Addresses read-only). The OAuth App flow is appropriately preserved in an accordion for users who specifically need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants