You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the WeChat Mini Program runtime scope split out of #2223.
WeChat Mini Programs do not provide the browser APIs expected by posthog-js or posthog-js-lite. They use platform-specific APIs such as wx.request, wx storage, and Mini Program lifecycle hooks.
Proposed scope
Provide an officially supported PostHog SDK for the WeChat Mini Program runtime, preferably built on @posthog/core.
MVP capabilities
Event capture
User identification and reset
Persistent and session super properties
Session tracking
Persistent event queue
Batching, retries, and explicit flushing using wx.request
Persistence using WeChat storage APIs
Appropriate flushing during Mini Program lifecycle transitions
Out of scope for the initial SDK
Browser DOM-based features such as web autocapture, heatmaps, and session replay require separate Mini Program-specific designs and should not be implied by the MVP.
Acceptance criteria
A supported package is published from this repository
Capture, identify, reset, super properties, and sessions work across app restarts
Networking and persistence use WeChat-supported APIs without browser polyfills
Background/foreground lifecycle behavior is covered
Unit tests cover persistence, batching, retries, sessions, and lifecycle transitions
A runnable WeChat Mini Program example and setup documentation are provided
Conclusion: Valid, well-scoped feature request for a new officially supported runtime SDK; it is not a small compatibility fix. Confidence: 94% Suggested labels:enhancement, web
Thanks — this is a clear request for a dedicated Mini Program SDK rather than browser-SDK compatibility. The proposed MVP and exclusions are appropriately scoped: it should use WeChat-native transport, storage, and lifecycle APIs, and should not imply support for DOM-dependent features such as autocapture, heatmaps, or replay.
@posthog/core provides the shared capture, identity, session, queue, batching, and retry behavior needed for a platform implementation, but this remains a new published package with a transport adapter, durable persistence behavior, lifecycle integration, test coverage, and a runnable example. It should be planned as a dedicated SDK effort rather than addressed through browser polyfills.
Investigation
PostHogCoreStateless explicitly requires platform implementations to provide fetch, library metadata, and synchronous persisted-property access through abstract methods, while retaining shared queueing, batching, retries, capture, identity, and session behavior.
PostHogFetchOptions and PostHogFetchResponse define a fetch-like promise interface, so a WeChat implementation would need a small wx.request adapter that translates its callback response into status, text(), and json().
posthog-js-lite is browser-specific: packages/web/src/posthog-web.ts uses browser storage, window, history APIs, and the Fetch API, so it is not a suitable Mini Program runtime target.
posthog-react-native demonstrates the existing supported pattern of extending PostHogCore, supplying storage and transport implementations, delaying initialization until asynchronous storage preload completes, and flushing/persisting on application lifecycle transitions.
packages/react-native/src/storage.ts provides React-Native-specific storage wrappers and cannot be reused directly for WeChat storage APIs.
No WeChat/Mini Program package or runnable example was found under the workspace packages or examples.
Reason: Although @posthog/core supplies the core analytics behavior, this request requires a new supported and published runtime package plus native transport, persistence durability, lifecycle semantics, test infrastructure, documentation, and a Mini Program example. Incorrect lifecycle or storage handling could lose or duplicate queued events.
Fix PR skipped: feature requests require an explicit trusted fix command or mode: fix before opening a draft PR
Activity
github-actions commentedon Aug 11, 2026
AI triage for #4491
Conclusion: Valid, well-scoped feature request for a new officially supported runtime SDK; it is not a small compatibility fix.
Confidence: 94%
Suggested labels:
enhancement,webThanks — this is a clear request for a dedicated Mini Program SDK rather than browser-SDK compatibility. The proposed MVP and exclusions are appropriately scoped: it should use WeChat-native transport, storage, and lifecycle APIs, and should not imply support for DOM-dependent features such as autocapture, heatmaps, or replay.
@posthog/coreprovides the shared capture, identity, session, queue, batching, and retry behavior needed for a platform implementation, but this remains a new published package with a transport adapter, durable persistence behavior, lifecycle integration, test coverage, and a runnable example. It should be planned as a dedicated SDK effort rather than addressed through browser polyfills.Investigation
PostHogCoreStatelessexplicitly requires platform implementations to providefetch, library metadata, and synchronous persisted-property access through abstract methods, while retaining shared queueing, batching, retries, capture, identity, and session behavior.PostHogFetchOptionsandPostHogFetchResponsedefine a fetch-like promise interface, so a WeChat implementation would need a smallwx.requestadapter that translates its callback response intostatus,text(), andjson().posthog-js-liteis browser-specific:packages/web/src/posthog-web.tsuses browser storage,window, history APIs, and the Fetch API, so it is not a suitable Mini Program runtime target.posthog-react-nativedemonstrates the existing supported pattern of extendingPostHogCore, supplying storage and transport implementations, delaying initialization until asynchronous storage preload completes, and flushing/persisting on application lifecycle transitions.packages/react-native/src/storage.tsprovides React-Native-specific storage wrappers and cannot be reused directly for WeChat storage APIs.Relevant files:
packages/core/src/posthog-core-stateless.ts,packages/core/src/posthog-core.ts,packages/core/src/types.ts,packages/web/src/posthog-web.ts,packages/react-native/src/posthog-rn.ts,packages/react-native/src/storage.ts,packages/core/package.json,pnpm-workspace.yamlFix assessment
Fix PR skipped: feature requests require an explicit trusted fix command or mode: fix before opening a draft PR
Pi session
The resumable JSONL pi session for this run was saved to a private gist: https://gist.github.com/marandaneto/0ffde89f160808dcfc855ef9e710596e
Download it locally, then fork it into your own pi session:
Saved session:
call-1-1-2026-08-11T12-49-59-243Z_019ff0df-61cb-7367-9bda-d9c6f5964a22.jsonlClose proposal
None. No issue close action was taken.
Generated by posthog-watcher-action using pi.