Tags: webiny/wts
Tags
fix: load posthog-js via a consumer-injected loader (#9) WTS no longer imports posthog-js itself. The web client previously did a bare `import("posthog-js")` guarded with `webpackIgnore` so consumers that don't record (e.g. the Webiny admin app, which doesn't install posthog-js) could still build. But webpackIgnore left a bare module specifier the browser can't resolve at runtime, so session recording silently failed in bundled apps (no traffic to s.webiny.com). Add `SessionRecordingConfig.loadPostHog`, a loader the consumer supplies as `() => import('posthog-js')`. The import resolves inside the consumer's bundle (where posthog-js is installed), and the library contains no posthog-js reference at all — so non-recording consumers build cleanly without webpackIgnore. Recording is skipped with a warning if no loader is given. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix: add distinctId support to the Node client (#8) The Node WTS client always read or minted `user.id` in ~/.webiny/config and had no way to use an externally-owned machine id. The Webiny admin and the website install/finish alias both key off the canonical @webiny/global-config top-level `id`, while the CLI used a separate `user.id` UUID — fragmenting funnels across CLI/admin/website. Add an optional `distinctId` to NodeClientConfig (mirroring the web client's fixedId). When provided it is used as-is and the config file is left untouched. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix: prevent bundlers from resolving optional posthog-js at build time ( #7) Use an opaque variable specifier plus webpackIgnore/vite-ignore magic comments so no bundler tries to resolve posthog-js during the build. Apps that don't install posthog-js will no longer fail to compile. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: publish @webiny/wts-client as public Scoped packages default to private on npm publish, which requires a paid npm plan. We want this on the free tier as a public package, so add publishConfig.access=public. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat!: rewrite to TypeScript as @webiny/wts-client v3 Browser entrypoint now actually proxies through t.webiny.com instead of loading Heap directly, restoring adblocker resistance for the marketing and docs sites. Identity moves from IP-as-userId to a UUID cookie on .webiny.com (90-day) with localStorage fallback. Honors WEBINY_TELEMETRY=false in both browser (localStorage) and Node (env var). Adds sendBeacon and keepalive support, plus an alias() method for the upcoming install/finish retro-merge flow. Three entrypoints — `@webiny/wts-client/web`, `/react`, `/node` — replace the previous web/admin/node JS files. The React entrypoint exposes <TelemetryProvider>, useTelemetry(), and useTrackPageView() with no Next.js coupling. Node entrypoint preserves the existing ~/.webiny/config user.id format for compatibility with webiny-js's packages/telemetry. Also bumps yarn from the broken berry 2.4.1 (TypeError on utimes patch application against modern Node) to yarn 4.5.0. BREAKING CHANGE: package renamed from `wts-client` to `@webiny/wts-client`. Drops `wts/src/web`, `wts/src/admin`, `wts/src/node` legacy JS files. Consumers must migrate to the new ESM exports map. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PreviousNext