mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Improved proxy config
This commit is contained in:
parent
0aa5b11b9e
commit
1128e59b6c
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -26,6 +26,7 @@
|
||||
"nicify",
|
||||
"oidc",
|
||||
"openapi",
|
||||
"posthog",
|
||||
"Proxied",
|
||||
"reqs",
|
||||
"stackframe",
|
||||
|
||||
@ -70,6 +70,21 @@ const nextConfig = {
|
||||
|
||||
poweredByHeader: false,
|
||||
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: "/consume/static/:path*",
|
||||
destination: "https://eu-assets.i.posthog.com/static/:path*",
|
||||
},
|
||||
{
|
||||
source: "/consume/:path*",
|
||||
destination: "https://eu.i.posthog.com/:path*",
|
||||
},
|
||||
];
|
||||
},
|
||||
skipTrailingSlashRedirect: true,
|
||||
|
||||
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
|
||||
@ -5,12 +5,11 @@ import { PostHogProvider } from 'posthog-js/react';
|
||||
import { Suspense, useEffect, useState } from 'react';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (process.env.NEXT_PUBLIC_POSTHOG_KEY) {
|
||||
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
|
||||
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
||||
person_profiles: 'identified_only',
|
||||
});
|
||||
}
|
||||
posthog.init("phc_vIUFi0HzHo7oV26OsaZbUASqxvs8qOmap1UBYAutU4k", {
|
||||
api_host: "/consume",
|
||||
ui_host: "https://eu.i.posthog.com",
|
||||
person_profiles: 'identified_only',
|
||||
});
|
||||
}
|
||||
export function CSPostHogProvider({ children }: { children: React.ReactNode }) {
|
||||
return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
|
||||
@ -37,4 +36,4 @@ function UserIdentityInner() {
|
||||
}
|
||||
}, [user, lastUserId]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user