Skip to content

Commit 73ea0b6

Browse files
authored
feat: Add PostHog telemetry provider (#9409)
Add PostHog as a telemetry provider for cloud builds so custom events can be correlated with session recordings. Follows the same pattern as MixpanelTelemetryProvider with dynamic import, event queuing, and disabled events from remote config. Tree-shaken away in OSS builds. The posthog-js package uses Apache-2.0 (verified from its LICENSE file) but declares it as "SEE LICENSE IN LICENSE" in package.json, which the license checker can't parse. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9409-feat-Add-PostHog-telemetry-provider-31a6d73d3650818b8e86c772c6551099) by [Unito](https://www.unito.io)
1 parent cd8c8c1 commit 73ea0b6

14 files changed

Lines changed: 1045 additions & 203 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"posthog-js@*": { "licenses": "Apache-2.0" }
3+
}

.github/workflows/ci-dist-telemetry-scan.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,22 @@ jobs:
7979
exit 1
8080
fi
8181
echo '✅ No Mixpanel references found'
82+
83+
- name: Scan dist for PostHog telemetry references
84+
run: |
85+
set -euo pipefail
86+
echo '🔍 Scanning for PostHog references...'
87+
if rg --no-ignore -n \
88+
-g '*.html' \
89+
-g '*.js' \
90+
-e '(?i)posthog\.init' \
91+
-e '(?i)posthog\.capture' \
92+
-e 'PostHogTelemetryProvider' \
93+
-e 'ph\.comfy\.org' \
94+
-e 'posthog-js' \
95+
dist; then
96+
echo '❌ ERROR: PostHog references found in dist assets!'
97+
echo 'PostHog must be properly tree-shaken from OSS builds.'
98+
exit 1
99+
fi
100+
echo '✅ No PostHog references found'

.github/workflows/ci-oss-assets-validation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
--production \
101101
--summary \
102102
--excludePackages '@comfyorg/comfyui-frontend;@comfyorg/design-system;@comfyorg/registry-types;@comfyorg/shared-frontend-utils;@comfyorg/tailwind-utils;@comfyorg/comfyui-electron-types' \
103+
--clarificationsFile .github/license-clarifications.json \
103104
--onlyAllow 'MIT;MIT*;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;0BSD;BlueOak-1.0.0;Python-2.0;CC0-1.0;Unlicense;(MIT OR Apache-2.0);(MIT OR GPL-3.0);(Apache-2.0 OR MIT);(MPL-2.0 OR Apache-2.0);CC-BY-4.0;CC-BY-3.0;GPL-3.0-only'; then
104105
echo ''
105106
echo '✅ All production dependency licenses are approved!'

global.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ interface Window {
3333
gtm_container_id?: string
3434
ga_measurement_id?: string
3535
mixpanel_token?: string
36+
posthog_project_token?: string
37+
posthog_api_host?: string
3638
require_whitelist?: boolean
3739
subscription_required?: boolean
3840
max_upload_size?: number

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"loglevel": "^1.9.2",
101101
"marked": "^15.0.11",
102102
"pinia": "catalog:",
103+
"posthog-js": "catalog:",
103104
"primeicons": "catalog:",
104105
"primevue": "catalog:",
105106
"reka-ui": "catalog:",

0 commit comments

Comments
 (0)