Skip to content

[CI] (0e81558) sveltekit/CMSaasStarter - #4259

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0e81558-sveltekit-CMSaasStarter
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0e81558-sveltekit-CMSaasStarter

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0e81558
App: sveltekit/CMSaasStarter
App directory: apps/sveltekit/CMSaasStarter
Workbench branch: wizard-ci-0e81558-sveltekit-CMSaasStarter
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-29T08:44:59.769Z
Duration: 503.9s

YARA Scanner

✓ 222 tool calls scanned, 0 violations detected

No violations: ✓ 222 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a SvelteKit-based CMSaasStarter app. It adds client-side initialization via hooks.client.ts, user identification tied to Supabase auth, error tracking with captureException, and nine meaningful custom events across account management, pricing, and contact flows. The svelte.config.js is correctly updated with paths.relative: false for session replay compatibility.

Files changed Lines added Lines removed
10 +104 -0

Confidence score: 5/5 🧙

  • No reverse proxy configured — browser-side posthog-js events are vulnerable to ad-blocker interception [MEDIUM]
  • Most capture() calls have no event properties — limits ability to filter/break down events in PostHog dashboards [MEDIUM]
  • posthog.logger.info() is not a documented PostHog JS SDK method — captureLog() is the documented API; these calls may silently fail at runtime [MEDIUM]

File changes

Filename Score Description
src/hooks.client.ts 5/5 New file: initializes PostHog via SvelteKit init() hook with env var validation and handleError for exception capture
.env.example 5/5 Documents PUBLIC_POSTHOG_PROJECT_TOKEN and PUBLIC_POSTHOG_HOST
package.json 5/5 Adds posthog-js ^1.434.7 to dependencies
svelte.config.js 5/5 Sets paths.relative: false — required for session replay with SSR
src/routes/(admin)/account/+layout.svelte 5/5 Adds posthog.identify() on mount with session.user.id and posthog.reset() on sign-out
src/routes/(admin)/account/(menu)/settings/settings_module.svelte 4/5 Adds capture events for profile/email/password/subscription updates and account deletion
src/routes/(admin)/account/(menu)/settings/change_password/+page.svelte 5/5 Captures password_setup_email_requested on success
src/routes/(admin)/account/create_profile/+page.svelte 3/5 Captures profile_created but uses posthog.logger.info() which is not a documented API
src/routes/(marketing)/contact_us/+page.svelte 3/5 Captures contact_request_submitted but also uses undocumented posthog.logger.info()
src/routes/(marketing)/pricing/pricing_module.svelte 4/5 Captures subscription_checkout_started with plan_id property; also uses undocumented posthog.logger.info()

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; all imports resolve correctly
Preserves existing env vars & configs Yes Existing Supabase and Stripe configs untouched; PostHog additions are additive
No syntax or type errors Yes Valid TypeScript and Svelte 5 syntax throughout
Correct imports/exports Yes posthog-js correctly imported client-side only; /dynamic/public used properly
Minimal, focused changes Yes All changes directly relate to PostHog integration
Pre-existing issues None —

Issues

  • posthog.logger.info() may not exist: The documented PostHog JS SDK exposes posthog.captureLog() for log capture, not posthog.logger.info(). These calls in create_profile/+page.svelte, contact_us/+page.svelte, and pricing_module.svelte may silently fail at runtime. Use posthog.captureLog({ body: "...", level: "info", attributes: {...} }) instead. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid — package.json dependency added correctly
  • svelte.config.js updated with paths.relative: false per SvelteKit docs requirement

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.434.7 added to package.json
PostHog client initialized Yes hooks.client.ts init() function uses posthog.init() with env vars, defaults, capture_exceptions, and logs config
capture() Yes 9 custom events across account, pricing, and contact flows
identify() Yes posthog.identify(session.user.id, { email: session.user.email }) in account layout on mount; posthog.reset() on sign-out
Error tracking Yes capture_exceptions: true in init config + handleError hook calls posthog.captureException(error)
Reverse proxy No No reverse proxy configured; browser-side events may be blocked by ad blockers

Issues

  • No reverse proxy: The SvelteKit docs recommend setting up a reverse proxy so browser-side events are less likely to be intercepted by ad blockers. Configure SvelteKit rewrites or use PostHog's managed reverse proxy. [MEDIUM]

Other completed criteria

  • API key loaded from PUBLIC_POSTHOG_PROJECT_TOKEN environment variable with validation
  • API host loaded from PUBLIC_POSTHOG_HOST environment variable with validation
  • paths.relative: false set in svelte.config.js — required for session replay with SSR
  • User identification uses stable session.user.id from Supabase auth (not email as distinct_id)
  • posthog.reset() correctly called on SIGNED_OUT event

PostHog insights and events ⚠️

Filename PostHog events Description
hooks.client.ts captureException Captures unhandled client errors via SvelteKit's handleError hook
account/+layout.svelte identify, reset Identifies user on mount with Supabase session; resets on sign-out
settings_module.svelte account_deletion_requested, profile_updated, email_change_requested, password_changed, email_subscription_updated Captures account settings actions based on form target
change_password/+page.svelte password_setup_email_requested Captures successful forgot-password email request
create_profile/+page.svelte profile_created Captures successful profile creation
contact_us/+page.svelte contact_request_submitted Captures successful contact form submission
pricing_module.svelte subscription_checkout_started Captures checkout click with plan_id property

Issues

  • Most events lack properties: Only subscription_checkout_started includes a property (plan_id). Events like contact_request_submitted, profile_updated, and account_deletion_requested would benefit from contextual properties (e.g., form_source, subscription_plan, profile_fields_updated) to enable richer filtering and breakdown in PostHog dashboards. [MEDIUM]

Other completed criteria

  • Events represent real user actions tied to actual product flows (account management, pricing, contact)
  • Events enable product insights — can build signup→profile_created→subscription_checkout_started funnel
  • No PII in event properties; email is correctly placed in identify() person properties
  • Event naming is consistent snake_case and descriptive

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants