Files
sase.tr/apps/web/package.json
Semih Yesilyurt 72c3fe0dc2 feat(surveys): replace Formbricks with self-rendered PostHog API surveys
Formbricks CE turned out to gate person-based targeting (setUserId/attributes
→ 403 enterprise) — the exact flexibility surveys need. PostHog already holds
the person properties, so surveys move back there in API mode: posthog-js
evaluates eligibility (event triggers, targeting flags like
subscription_status=active, wait periods, per-distinct_id dedup) via
getActiveMatchingSurveys, and we render the popover ourselves — zero PostHog
branding, sase.tr dark-theme styling.

- lib/surveys.ts: display manager + capture payload builders that mirror
  posthog-js's own "survey shown/dismissed/sent" shapes exactly
  ($survey_response_<qid>, $set $survey_dismissed/<id>[/iter], seenSurvey_*,
  lastSeenSurveyDate) so the PostHog Surveys results UI works unchanged
- components/survey-popover.tsx: single_choice (+Diğer), open text, rating/NPS
- posthog.ts: capture/pageview/identify now schedule survey checks; register
  deploy_env (dev.sase.tr ships the key now → staging traffic is filterable)
- remove @formbricks/js, its CSP entries and build args

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 00:40:18 +03:00

64 lines
1.8 KiB
JSON

{
"name": "web",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite --port 3000",
"generate-routes": "tsr generate",
"build": "tsr generate && tsc -b && vite build",
"prerender": "node scripts/prerender.mjs",
"preview": "vite preview --port 3000",
"lint": "biome check src/",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests",
"test:watch": "vitest",
"clean": "rm -rf dist"
},
"dependencies": {
"@cardog-icons/react": "^1.1.1",
"@grafana/faro-web-sdk": "^2.2.4",
"@grafana/faro-web-tracing": "^2.2.4",
"@remotion/player": "^4.0.422",
"@sase/shared": "workspace:*",
"@sase/ui": "workspace:*",
"@sentry/react": "^9.0.0",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-router": "^1.120.0",
"better-auth": "^1.2.0",
"canvas-confetti": "^1.9.4",
"clsx": "^2.1.0",
"lucide-react": "^0.468.0",
"posthog-js": "^1.347.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-markdown": "^9.1.0",
"remark-gfm": "^4.0.1",
"remotion": "^4.0.422",
"sileo": "^0.0.7",
"tailwind-merge": "^2.6.0",
"zod": "^3.24.0",
"zustand": "^5.0.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.0",
"@tailwindcss/vite": "^4.0.0",
"@tanstack/react-router-devtools": "^1.120.0",
"@tanstack/router-cli": "^1.159.4",
"@tanstack/router-plugin": "^1.120.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/canvas-confetti": "^1.9.0",
"@types/node": "^22.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.5.0",
"jsdom": "^28.0.0",
"postcss": "^8.4.0",
"tailwindcss": "^4.0.0",
"typescript": "^5.7.0",
"vite": "^6.3.0",
"vitest": "^3.2.4"
}
}