mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 11:05:31 +08:00
feat(kilo-docs): add PostHog reverse proxy via Next.js rewrites
This commit is contained in:
@@ -3,4 +3,4 @@ NEXT_PUBLIC_ALGOLIA_API_KEY=zyz6789
|
||||
NEXT_PUBLIC_ALGOLIA_INDEX_NAME="Kilo Code Docs"
|
||||
NEXT_PUBLIC_ALGOLIA_ASSISTANT_ID=foo-bar
|
||||
NEXT_PUBLIC_POSTHOG_KEY=phc_QWERTY
|
||||
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
|
||||
# NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com # no longer needed; proxy via /ingest rewrites
|
||||
@@ -2,7 +2,8 @@ import posthog from "posthog-js"
|
||||
|
||||
if (process.env.NEXT_PUBLIC_POSTHOG_KEY) {
|
||||
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
|
||||
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
||||
api_host: "/ingest",
|
||||
ui_host: "https://us.posthog.com",
|
||||
person_profiles: "identified_only",
|
||||
capture_pageview: false, // Handled manually in _app.tsx on routeChangeComplete
|
||||
capture_pageleave: true,
|
||||
|
||||
@@ -5,6 +5,7 @@ module.exports = withMarkdoc(/* config: https://markdoc.io/docs/nextjs#options *
|
||||
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdoc"],
|
||||
basePath: "/docs",
|
||||
turbopack: {},
|
||||
skipTrailingSlashRedirect: true,
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
@@ -30,6 +31,11 @@ module.exports = withMarkdoc(/* config: https://markdoc.io/docs/nextjs#options *
|
||||
destination: "/api/llms.txt",
|
||||
},
|
||||
],
|
||||
afterFiles: [
|
||||
{ source: "/ingest/static/:path*", destination: "https://us-assets.i.posthog.com/static/:path*" },
|
||||
{ source: "/ingest/decide", destination: "https://us.i.posthog.com/decide" },
|
||||
{ source: "/ingest/:path*", destination: "https://us.i.posthog.com/:path*" },
|
||||
],
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user