Files
ComfyUI_frontend/src/platform
Glary-Bot 218b3cb260 feat(billing): add Churnkey cancellation flow integration
Replaces the simple cancel-subscription confirmation dialog with the
Churnkey-hosted cancel flow when the churnkey_cancellation_enabled
feature flag is on, so we can collect survey data and run cancellation
A/B tests through the Churnkey dashboard.

- Vite plugin (cloud-only) injects the Churnkey embed loader using
  VITE_CHURNKEY_APP_ID; non-cloud builds and missing env var no-op.
- useChurnkey composable wraps window.churnkey.init; launcher fetches
  HMAC credentials from /api/billing/churnkey/auth and delegates
  cancellation to the existing /api/billing/subscription/cancel via
  handleCancel so the backend stays the source of truth.
- Feature-flag gating via useFeatureFlags + remoteConfig falls back to
  the legacy dialog whenever the flag is off, Churnkey is unconfigured,
  or the embed script fails to load.
- New PostHog events: cancellation_flow_opened, cancellation_flow_closed
  (with outcome), and cancellation_reconsidered (sets a user-level
  property for downstream cohort analysis).
2026-05-08 23:13:03 +00:00
..