Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"ngx-stripe": "^19.0.0",
"pluralize": "^8.0.0",
"postgres-interval": "^4.0.2",
"posthog-js": "^1.341.0",
"private-ip": "^3.0.2",
"puppeteer": "^24.29.1",
"rxjs": "^7.4.0",
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { CookieService } from 'ngx-cookie-service';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { NgxStripeModule } from 'ngx-stripe';
import posthog from 'posthog-js';
import { AppComponent } from './app/app.component';
import { AppRoutingModule } from './app/app-routing.module';
import { ConfigModule } from './app/modules/config.module';
Expand Down Expand Up @@ -83,6 +84,11 @@ if ((environment as any).saas) {
});
}

posthog.init('phc_VPnWHIMj9UjhRLPr7shATjgL0J4KrWWOHkK3JwZbnkw', {
api_host: 'https://us.i.posthog.com',
defaults: '2025-11-30',

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration option 'defaults' with value '2025-11-30' appears to be invalid. PostHog's init method does not have a 'defaults' configuration option documented in their API. This may have been intended to be 'person_profiles' or another valid configuration option. Additionally, the date '2025-11-30' is in the past (current date is February 2026), which suggests this may be a placeholder or incorrect value. Please verify the intended configuration option and its correct value.

Suggested change
defaults: '2025-11-30',

Copilot uses AI. Check for mistakes.
});
Comment on lines +87 to +90

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog initialization should be conditional based on environment, similar to how Sentry is initialized only when the saas flag is true (lines 73-85). Currently, PostHog will initialize in all environments including local development, which may not be desired and could lead to test/development data being sent to PostHog.

Copilot uses AI. Check for mistakes.

Comment on lines +87 to +91

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PostHog API key is hardcoded directly in the source code. This is a security concern as the key will be visible in version control history and to anyone with access to the repository. Consider moving this to environment configuration files or a secure configuration service, following the same pattern used for Stripe keys (lines 64-67) or Sentry DSN (line 75).

Suggested change
posthog.init('phc_VPnWHIMj9UjhRLPr7shATjgL0J4KrWWOHkK3JwZbnkw', {
api_host: 'https://us.i.posthog.com',
defaults: '2025-11-30',
});
const posthogApiKey = (environment as any).posthogApiKey;
if (posthogApiKey) {
posthog.init(posthogApiKey, {
api_host: 'https://us.i.posthog.com',
defaults: '2025-11-30',
});
}

Copilot uses AI. Check for mistakes.
bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(
Expand Down
Loading
Loading