Feat: Enable Poshog and Sentry for OSS (#23)

feat: enable posthog and sentry for oss
This commit is contained in:
Abhishek 2025-10-04 12:23:20 +05:30 committed by GitHub
parent 8e2e5c9327
commit 90f7aac8ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 59 deletions

View file

@ -0,0 +1,16 @@
/*
Route to enable/ disable posthog from a NextJS backend route,
rather than NEXT_PUBLIC_* keys, since NEXT_PUBLIC_* keys are
injected during build time, and we need to provide the option
to OSS users to disable telemetry from docker-compose.yaml
*/
import { NextResponse } from 'next/server';
export async function GET() {
return NextResponse.json({
enabled: process.env.ENABLE_POSTHOG === 'true',
key: process.env.POSTHOG_KEY || '',
host: process.env.POSTHOG_HOST || '/ingest',
uiHost: process.env.POSTHOG_UI_HOST || 'https://us.posthog.com',
});
}

View file

@ -0,0 +1,9 @@
import { NextResponse } from 'next/server';
export async function GET() {
return NextResponse.json({
enabled: process.env.ENABLE_SENTRY === 'true',
dsn: process.env.SENTRY_DSN || '',
environment: process.env.NODE_ENV || 'development',
});
}