feat(surveys): Formbricks in-app survey bridge over PostHog events

Self-hosted Formbricks (anket.sase.tr) replaces PostHog surveys (free-tier
branding). PostHog stays the single instrumentation source: capture() forwards
allowlisted trigger events (trial_urgency_banner_viewed, subscription_cancelled,
onboarding_completed, vin_decode_error, empty_catalog_cta_clicked) to the
Formbricks SDK, identify/reset/people-properties mirror into Formbricks
attributes, and $pageview registers SPA route changes for no-code triggers.

- apps/web/src/lib/formbricks.ts: lazy fire-and-forget wrapper (inert without
  VITE_FORMBRICKS_APP_URL + VITE_FORMBRICKS_ENV_ID)
- CSP: allow anket.sase.tr in connect-src/img-src
- Dockerfile + compose: bake the two VITE_ build args

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 23:44:45 +03:00
parent 4716232398
commit 597391bbdf
8 changed files with 124 additions and 63 deletions

View File

@@ -30,6 +30,8 @@ ARG VITE_POSTHOG_KEY=
ARG VITE_META_PIXEL_ID=
ARG VITE_CHATWOOT_BASE_URL=
ARG VITE_CHATWOOT_WEBSITE_TOKEN=
ARG VITE_FORMBRICKS_APP_URL=
ARG VITE_FORMBRICKS_ENV_ID=
RUN pnpm build