Skip to content

@resq-sw/analytics@0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 10 May 16:44
· 20 commits to master since this release
Immutable release. Only release title and notes can be modified.
8cd8b48

@resq-sw/analytics

0.3.0

Minor Changes

  • #62 14ca5d5 Thanks @WomB0ComB0! - Add ResQ-specific helpers shared across the three TS surfaces (landing,
    research, viz):

    • RESQ_SUBDOMAIN_ALLOWLISTreadonly string[] of resq.software,
      research.resq.software, viz.resq.software. Pass to
      AnalyticsConfig.ga4.domains for cross-domain linker setup.
    • GA4_ID_PATTERN / sanitizeGa4Id(id) — strict
      /^G-[A-Z0-9]{6,32}$/ validator that returns the ID when valid or
      null otherwise. Use before interpolating an env-var-sourced GA4 ID
      into an inline <script> body — closes CodeQL
      js/bad-code-sanitization and prevents </script> /
      line-terminator escapes.
    • resolveResqCookieDomain(host) — returns ".resq.software" only
      when host actually belongs to the registrable root, otherwise
      undefined. Use in browser code that reads
      window.location.hostname so preview / localhost deployments
      don't get their cookie rejected with a domain mismatch.

    Centralising these means adding a fourth subdomain or tightening the
    GA4-ID format becomes a single version bump instead of three
    coordinated edits across consumer repos.

0.2.0

Minor Changes

  • #60 98dce28 Thanks @WomB0ComB0! - Add @resq-sw/analytics — unified PostHog + GA4 client for the ResQ platform.

    • Cross-subdomain identity (resq.software, research.resq.software, viz.resq.software) via shared cookie domain and GA4 linker.
    • Lazy-loaded posthog-js via dynamic import — zero impact on initial bundle.
    • Subpath exports: @resq-sw/analytics, @resq-sw/analytics/react, @resq-sw/analytics/next.
    • Augmentable AnalyticsEvents interface for type-safe track() calls.
    • withAnalyticsRewrites() Next.js helper for the PostHog reverse-proxy pattern (survives ad-blockers, keeps cookies first-party).