From 5c0088b6e9b8b9020a323d10b7fee32165a0f859 Mon Sep 17 00:00:00 2001 From: aadesh18 <110230993+aadesh18@users.noreply.github.com> Date: Sun, 12 Apr 2026 17:25:14 -0700 Subject: [PATCH 1/2] welcome page changes (#1311) This PR is for the Welcome page in Mintlify docs. --- docs-mintlify/index.mdx | 147 ++++++++++++++++++++++++++++------------ 1 file changed, 105 insertions(+), 42 deletions(-) diff --git a/docs-mintlify/index.mdx b/docs-mintlify/index.mdx index f28ec3b57..00e7629f0 100644 --- a/docs-mintlify/index.mdx +++ b/docs-mintlify/index.mdx @@ -4,7 +4,23 @@ description: "Stack Auth documentation for setup, components, SDK usage, and RES sidebarTitle: "Overview" --- -
+export const SectionLink = ({ href, children }) => ( + {children} +); + +export const ChipLink = ({ href, children }) => ( + {children} +); + +export const CardTitle = ({ href, children }) => ( + {children} +); + +export const CardChip = ({ href, children }) => ( + {children} +); + +
-

Explore the Docs

+

Navigate Through Our Docs

- Jump into the part of the platform that matches how you are integrating Stack Auth. + Start at the top and work your way down, or jump straight to the section you need.

- - - Installation, environment setup, and the first authentication flow. - - - Configure prebuilt React and Next.js auth UI, providers, and handlers. - - - Hooks, objects, and types for working with users, teams, projects, and sessions. - - - HTTP APIs for client, server, admin, and webhook integrations in any stack. - - -
+

Recommended Order

-
-
-

Common Tasks

-

- Start from practical guides for the features teams tend to configure first. -

+
+ {/* Getting Started */} +
+
+ Getting Started +

First-time setup, install the SDK, get auth running in minutes.

+
+ Setup + Users + AI Integration + Production +
+
+ + {/* Components */} +
+
+ Components +

Drop-in UI for sign-in, sign-up, account settings, and team switching.

+
+ SignIn / SignUp +
+
+ + {/* SDK Reference */} +
+
+ SDK Reference +

Hooks, types, and objects for reading and writing user data in code.

+
+ useUser + Types + StackApp +
+
+ {/* Branch divider */} +
+
+ Then pick your path +
+
+ + {/* Branching cards */} +
+
+ Going Further +

Stack App configuration, backend integration, local development, metadata.

+
+ Stack App + Local dev + Backend +
+
+
+ Apps +

Authentication, emails, payments, webhooks, API keys.

+
+ Auth + Emails + Payments +
+
+
+ REST API +

HTTP endpoints for any backend or language.

+
+ REST API + Webhooks +
+
+
+ +

Explore Apps

+ - - Set up publishable, secret, user, and team API keys. - - - Define roles and permission models for projects and teams. - - - Trigger downstream systems from auth, user, and team events. - - - Understand how Stack Auth fits into your server architecture. - - - Connect Stack Auth docs and workflows to AI-enabled development tools. - - - Check answers to common setup, integration, and product questions. - + + + + + + + + + + +
From 7434d84ab1ac5e7b97dbbbeddb93cedc77854a89 Mon Sep 17 00:00:00 2001 From: aadesh18 <110230993+aadesh18@users.noreply.github.com> Date: Sun, 12 Apr 2026 18:11:12 -0700 Subject: [PATCH 2/2] Custom Dashboards bug fix (#1299) This PR is to fix the bug pointed out by Madison on gc. ## Summary by CodeRabbit * **Bug Fixes** * Improved system reliability by correcting internal guidance for user-data handling, preventing unsafe retrieval patterns and reducing risk of incorrect or incomplete user responses. * **Chores** * Tightened AI system prompts with stricter runtime validation and selection rules to ensure user queries return accurate, privacy-safe results. --- apps/backend/src/lib/ai/prompts.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/backend/src/lib/ai/prompts.ts b/apps/backend/src/lib/ai/prompts.ts index 1ce70b5af..21105a425 100644 --- a/apps/backend/src/lib/ai/prompts.ts +++ b/apps/backend/src/lib/ai/prompts.ts @@ -419,6 +419,25 @@ await stackServerApp.listInternalApiKeys() // Admin API Violating this is a failure condition. +──────────────────────────────────────── +CRITICAL: getUser() WITHOUT ARGUMENTS DOES NOT WORK +──────────────────────────────────────── +The dashboard runs inside a sandboxed iframe with a StackAdminApp initialized via projectOwnerSession. +There is NO client-side user session — stackServerApp.getUser() with no arguments will return null or throw. + +NEVER call stackServerApp.getUser() without arguments. +NEVER call stackServerApp.getServerUser(). + +When the user asks about "the user", "user data", or "current user", they mean an end-user of their project. +Use the admin API pattern instead: +- stackServerApp.listUsers({ includeAnonymous: true, query?: string }) to list/search users (show a user picker or table; always include includeAnonymous: true) +- stackServerApp.getUser(userId) to fetch a specific user by ID + +Example — user management dashboard: +const users = await stackServerApp.listUsers({ includeAnonymous: true }); +// Show a list/table, let the admin select a user +const selectedUser = await stackServerApp.getUser(selectedUserId); + ──────────────────────────────────────── RUNTIME CONTRACT (HARD RULES) ──────────────────────────────────────── @@ -449,6 +468,8 @@ Users: - Prefer limit: 500 (or higher only if clearly necessary) - Avoid pagination/cursor unless the UI explicitly needs it - Result is an array that may contain .nextCursor; treat it as an array for normal usage +- stackServerApp.getUser(userId) → fetch a single user by ID + - NEVER call getUser() without a userId argument (see above) Teams: - stackServerApp.listTeams(options?) → Promise