stack/docs/next.config.mjs
Madison 9e2cd4d50e
[Docs] - Full cleanup (#1105)
<!--

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

* **Removed Features**
  * Dashboard embed functionality has been removed from the platform.
  * Python template documentation and guides have been removed.

* **Documentation**
* Documentation structure has been significantly reorganized and
simplified.
  * Extensive template content and component guides have been removed.
* Apple OAuth integration guide updated with streamlined secret
generation flow.

* **Refactor**
  * Button component styling and variant system updated.
  * Routing configuration updated with simplified path handling.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-27 00:38:51 -06:00

109 lines
2.9 KiB
JavaScript

import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
const dashboardUrl = process.env.NEXT_PUBLIC_STACK_DASHBOARD_URL || 'http://localhost:8101';
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
eslint: {
// Temporarily disable ESLint during builds for Vercel deployment
ignoreDuringBuilds: false,
},
async headers() {
return [
{
// Allow CORS for docs-embed routes to be accessed by the dashboard app
source: '/docs-embed/:path*',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: dashboardUrl, // Dashboard app origin
},
{
key: 'Access-Control-Allow-Methods',
value: 'GET, POST, PUT, DELETE, OPTIONS',
},
{
key: 'Access-Control-Allow-Headers',
value: 'Content-Type, Authorization',
},
],
},
{
// Allow CORS for api-embed routes to be accessed by the dashboard app
source: '/api-embed/:path*',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: dashboardUrl, // Dashboard app origin
},
{
key: 'Access-Control-Allow-Methods',
value: 'GET, POST, PUT, DELETE, OPTIONS',
},
{
key: 'Access-Control-Allow-Headers',
value: 'Content-Type, Authorization',
},
],
},
];
},
// Include OpenAPI files in output tracing for Vercel deployments
outputFileTracingIncludes: {
'/**/*': ['./content/**/*', './openapi/**/*'],
},
async redirects() {
return [
// Redirect root to docs overview
{
source: '/',
destination: '/docs/overview',
permanent: false,
},
// Redirect /docs/api to the overview page
{
source: '/docs/api',
destination: '/docs/api/overview',
permanent: false,
},
];
},
async rewrites() {
return [
// PostHog proxy rewrites to prevent ad blockers
{
source: "/consume/static/:path*",
destination: "https://eu-assets.i.posthog.com/static/:path*",
},
{
source: "/consume/:path*",
destination: "https://eu.i.posthog.com/:path*",
},
{
source: "/consume/decide",
destination: "https://eu.i.posthog.com/decide",
},
// Redirect .mdx requests to the llms.mdx route handler
{
source: '/docs/:path*.mdx',
destination: '/llms.mdx/:path*',
},
{
source: '/api/:path*.mdx',
destination: '/llms.mdx/:path*',
},
// Serve OpenAPI files from the openapi directory
{
source: '/openapi/:path*',
destination: '/openapi/:path*',
},
// No other rewrites needed for API docs - they're served directly from /docs/api/*
];
},
};
export default withMDX(config);