Skip to content

Add official WeChat Mini Program SDK #4491

Description

@marandaneto

Context

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

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions