Skip to content

Jitsu Client Libraries Release 1.11.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Jun 10:35
· 5 commits to newjitsu since this release

Jitsu Client Libraries 1.11.0

Changes that affect users of @jitsu/js (and @jitsu/react) since 1.10.4. Build/tooling, packaging and internal refactors are omitted.

New features

  • GTM destination — self-managed loading. New loadGtm option lets you load Google Tag Manager yourself; Jitsu then only pushes to the data layer instead of injecting the GTM script. New resetDataLayer option (default true) controls whether Jitsu clears the data it pushed between events, clearing only Jitsu-set keys rather than resetting the whole data layer.
  • preInitAnonymousId option. Creates the anonymous-id cookie synchronously at init, so the id is available for first-page server-side reads instead of being set lazily on the first event.
  • Auto-identify on init. If userId is passed in the options, the client now writes it to storage and automatically sends an identify on startup, so the user is identified before your first explicit call.
  • New user() method. Returns the current user — privacy-aware (returns no id when user ids are disabled) and falls back to the configured userId until reset() is called.

Fixes

  • Array values in traits / properties / context are now replaced wholesale on merge instead of being merged element-by-element (prevents stale array items leaking between merges).
  • Server-side / no-URL events no longer throw when there is no page URL (Node / SSR usage).
  • Script-tag data-* attribute parsing is now null-safe — a missing attribute no longer crashes initialization.
  • Auto-identify failures are logged as warnings instead of being routed to your configured error handler, so they can't trip your error policy.
  • Correct anonymous-id cookie scoping on vercel.app and webflow.io (added to the public-suffix list).
  • ga4: skip the page_view event when page properties are missing (avoids emitting malformed events).
  • logrocket: guard against a missing method when flushing queued calls.

Behavior changes — please review when upgrading from 1.10.4

  • Passing userId in the constructor options now triggers an automatic identify on init and populates user().id before any explicit identify() call. If you relied on no event being sent until your first call, this is a new network side-effect.
  • Array values in event payloads now fully replace rather than element-wise merge — payloads that combine arrays may serialize differently than in 1.10.4.

Full diff: jitsu-js-libs-v1.10.4...jsclient1.11.0