mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Preview mode: sandboxed experience with mock projects, placeholder data, and disabled external integrations (payments, webhooks, email rendering, session replays). * One-click preview project creation and automatic preview sign-in for quick access. * **New Features — Walkthrough** * Interactive guided walkthroughs with spotlight, animated cursor, step-driven navigation, and targeted element hooks. * **Style** * UI/UX adjustments for preview: theme behavior, conditional banners/alerts, informational alerts, and walkthrough attributes added across pages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { getPublicEnvVar } from "@/lib/env";
|
|
import { StackServerApp } from '@stackframe/stack';
|
|
import { throwErr } from '@stackframe/stack-shared/dist/utils/errors';
|
|
import './polyfills';
|
|
|
|
if (getPublicEnvVar("NEXT_PUBLIC_STACK_PROJECT_ID") !== "internal") {
|
|
throw new Error("This project is not configured correctly. stack-dashboard must always use the internal project.");
|
|
}
|
|
|
|
const isPreview = getPublicEnvVar("NEXT_PUBLIC_STACK_IS_PREVIEW") === "true";
|
|
|
|
export const stackServerApp = new StackServerApp({
|
|
baseUrl: {
|
|
browser: getPublicEnvVar("NEXT_PUBLIC_BROWSER_STACK_API_URL") ?? getPublicEnvVar("NEXT_PUBLIC_STACK_API_URL") ?? throwErr("NEXT_PUBLIC_BROWSER_STACK_API_URL is not set"),
|
|
server: getPublicEnvVar("NEXT_PUBLIC_SERVER_STACK_API_URL") ?? getPublicEnvVar("NEXT_PUBLIC_STACK_API_URL") ?? throwErr("NEXT_PUBLIC_SERVER_STACK_API_URL is not set"),
|
|
},
|
|
projectId: "internal",
|
|
publishableClientKey: getPublicEnvVar("NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY"),
|
|
tokenStore: isPreview ? "memory" : "nextjs-cookie",
|
|
urls: {
|
|
afterSignIn: "/projects",
|
|
afterSignUp: "/new-project",
|
|
afterSignOut: "/",
|
|
},
|
|
analytics: {
|
|
replays: {
|
|
maskAllInputs: false,
|
|
enabled: !isPreview,
|
|
},
|
|
},
|
|
});
|