mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-13 12:55:19 +00:00
include host in webserver events
This commit is contained in:
parent
eac7ea0555
commit
760db9f3e1
1 changed files with 4 additions and 0 deletions
|
|
@ -85,6 +85,9 @@ export async function captureEvent<E extends PosthogEvent>(event: E, properties:
|
||||||
|
|
||||||
const distinctId = await tryGetDistinctId();
|
const distinctId = await tryGetDistinctId();
|
||||||
|
|
||||||
|
const headersList = await headers();
|
||||||
|
const host = headersList.get("host") ?? undefined;
|
||||||
|
|
||||||
const posthog = new PostHog(env.POSTHOG_PAPIK, {
|
const posthog = new PostHog(env.POSTHOG_PAPIK, {
|
||||||
host: 'https://us.i.posthog.com',
|
host: 'https://us.i.posthog.com',
|
||||||
flushAt: 1,
|
flushAt: 1,
|
||||||
|
|
@ -97,6 +100,7 @@ export async function captureEvent<E extends PosthogEvent>(event: E, properties:
|
||||||
...properties,
|
...properties,
|
||||||
sourcebot_version: clientEnv.NEXT_PUBLIC_SOURCEBOT_VERSION,
|
sourcebot_version: clientEnv.NEXT_PUBLIC_SOURCEBOT_VERSION,
|
||||||
install_id: env.SOURCEBOT_INSTALL_ID,
|
install_id: env.SOURCEBOT_INSTALL_ID,
|
||||||
|
$host: host,
|
||||||
},
|
},
|
||||||
distinctId,
|
distinctId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue