mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
Feat: Enable Poshog and Sentry for OSS (#23)
feat: enable posthog and sentry for oss
This commit is contained in:
parent
8e2e5c9327
commit
90f7aac8ad
6 changed files with 118 additions and 59 deletions
16
ui/src/app/api/config/posthog/route.ts
Normal file
16
ui/src/app/api/config/posthog/route.ts
Normal 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',
|
||||
});
|
||||
}
|
||||
9
ui/src/app/api/config/sentry/route.ts
Normal file
9
ui/src/app/api/config/sentry/route.ts
Normal 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',
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue