Togo
Togo
Apply for the betaSign in

Changelog

@togohq/sdk-browser changelog

What changed in each published version of @togohq/sdk-browser. Compare the version in your package.json with the newest one here.

  1. @togohq/sdk-browser 2.5.0

    Version 2.5.0 introduces web autocapture and improves event handling

    • Browser SDK

    New

    • Web Autocapture: Automatically captures $page_viewed and $page_left events with visible time and scroll depth.

    Improved

    • AutocaptureOptions is now exported from the package entry point, simplifying type imports.

    Fixed

    • Autocapture: Disabled clients now correctly stop autocapture, preventing unnecessary event listeners.
    • Autocapture: Correctly handles scroll events from elements like carousels, ensuring accurate page depth measurement.
    • Autocapture: Ensures a view ended by a path change retains its own scroll depth.
    • Autocapture: New views in single-page apps no longer start with the previous page's scroll depth.
    • The page-close batch now skips oversized events instead of stopping, ensuring other events are sent.
    • A full queue no longer evicts events that are currently uploading, preventing false loss reports.
    • The page-close send now operates independently of ongoing uploads, ensuring events are sent before page unload.
    • Unserializable events are dropped at track() to prevent blocking subsequent batches.
  2. @togohq/sdk-browser 2.4.0

    Version 2.4.0 reports property names Togo cannot use

    • Browser SDK

    New

    • A property name over 64 characters, with a control character, or containing an email address is reported through onError as property_name_invalid (or person_property_name_invalid on a profile write). Togo could not query it.

    Improved

    • With a live key, such a property is now dropped and the rest of the event is sent. With a test key it is sent as well, so verify_tracking reports it.
    • With a test key, a property name starting with $ is now reported through onError as property_reserved too.
  3. @togohq/sdk-browser 2.3.0

    Version 2.3.0 introduces new app lifecycle events and device information capabilities

    • Browser SDK

    New

    • device.manufacturer is now included in the batch envelope, allowing for more precise device identification. This field is optional and is bounded at 64 characters.
    • New reserved events $app_installed, $app_updated, and $app_opened have been defined, with specific sources that can send each event.
    • init({ appVersion, appBuild }) now supports sending app version and build information once per upload. Each value must be between 1 and 64 characters.
    • The batch envelope now includes optional app and device objects, with fields such as version, build, os, osVersion, model, and deviceType. Each string is bounded at 64 characters.
  4. @togohq/sdk-browser 2.2.0

    Version 2.2.0 updates error and diagnostic codes for improved clarity

    • Browser SDK

    Breaking

    • BREAKING: Error and diagnostic codes have been renamed for consistency and clarity. For example, invalid_property_type is now property_value_wrong_type, and shutdown_undelivered is now shutdown_flush_failed. Update any handlers that switch on these codes to use the new names.

    Migration

    Update error and diagnostic code handlers to use the new code names.

    Before
    onError: (e) => {
      if (e.code === 'shutdown_undelivered') {
        handleShutdownError();
      }
    };
    After
    onError: (e) => {
      if (e.code === 'shutdown_flush_failed') {
        handleShutdownError();
      }
    };

    The old form stops working in 2.2.0.

  5. @togohq/sdk-browser 2.1.0

    @togohq/sdk-browser 2.1.0

    • Browser SDK

    Breaking

    • email and name are no longer keys of set or setOnce: pass them as the email and name parameters. A plain email or name key in set no longer type-checks, and the server drops one as person_property_reserved.
    • A property key starting with $ is reserved for Togo. Under a live key the SDK drops it, logs it once and still sends the event; under a test key it is sent, so verify_tracking reports property_reserved or person_property_reserved.

    New

    • init({ onError }) is called once for every event, or part of one, that will not be recorded, and once when the client stops sending, in production too. Pass it to your error tracker: onError: (e) => Sentry.captureMessage(e.message). Each error carries a code.
    • setPersonProperties({ email, name }) sets a person's email address and name through typed parameters. null removes one.

    Fixed

    • A queue_full caused by one oversized event names that event, instead of reading as being offline.

    Migration

    Pass email and name as parameters of setPersonProperties(), not as keys of set.

    Before
    setPersonProperties({ set: { email: user.email, name: user.name } });
    After
    setPersonProperties({ email: user.email, name: user.name });

    The old form stops working in 2.1.0.

  6. @togohq/sdk-browser 2.0.0

    Version 2.0.0 introduces breaking changes to session management and experiment tracking

    • Browser SDK

    Breaking

    • BREAKING: init({ sessionId }) and SessionIdMode 'custom' options are removed. Session IDs are now managed by the SDK.

    New

    • getExperiment(name) is introduced to manage experiment assignments, caching results and recording $experiment_entered events.
    • $session_started is now automatically sent by the SDK, marking the start of a session.

    Improved

    • The SDK now owns every session ID, automatically generating and managing them internally.

    Fixed

    • The reserved-name log now correctly follows other drops, and non-string names are logged and dropped.

    Migration

    Remove custom session ID initialization and rely on SDK-managed session IDs.

    Before
    init({ sessionId: 'custom-id' });
    After
    init();

    The old form stops working in 2.0.0.

  7. @togohq/sdk-browser 1.3.0

    Version 1.3.0 introduces session timeout in seconds and fixes session timeout handling

    • Browser SDK

    Breaking

    • BREAKING: DEFAULT_SESSION_TIMEOUT_MS is now DEFAULT_SESSION_TIMEOUT_SECONDS, and SESSION_HARD_CAP_MS is no longer exported.
    • BREAKING: batchSize and flushIntervalMs options are removed; batching is fixed at 50 events or 5 seconds.

    Deprecated

    • sessionTimeoutMs is deprecated in favor of sessionTimeoutSeconds and will be removed in a future version.

    New

    • sessionTimeoutSeconds is now available to set session idle timeout in seconds, defaulting to 1800.

    Fixed

    • A null or NaN session timeout now defaults correctly, preventing sessions from being turned off unintentionally.

    Migration

    Update session timeout and batching configurations to use new constants and options.

    Before
    (DEFAULT_SESSION_TIMEOUT_MS, sessionTimeoutMs, batchSize, flushIntervalMs);
    After
    (DEFAULT_SESSION_TIMEOUT_SECONDS, sessionTimeoutSeconds);

    The old form stops working in 1.3.0.

  8. @togohq/sdk-browser 1.2.0

    Version 1.2.0 introduces event ID returns and updates email handling rules

    • Browser SDK

    Breaking

    • The governance wire's declared and contractSha256 are now defined and definitionSha256; DeclaredEvent is now DefinedEvent.

    New

    • track(), identify(), setPersonProperties() now return the eventId of the event they queued, or undefined when no event is sent.

    Improved

    • Session IDs are no longer rejected for resembling emails; diagnostics attach to TEST events only.

    Fixed

    • The scenario driver's Intl stub now survives a fake clock by using a regular function instead of an arrow function.

    Migration

    Update governance wire and event types to use 'defined' instead of 'declared'.

    Before
    (DeclaredEvent, declared, contractSha256);
    After
    (DefinedEvent, defined, definitionSha256);

    The old form stops working in 1.2.0.

  9. @togohq/sdk-browser 1.1.0

    Version 1.1.0 introduces default properties, timezone, and page context features

    • Browser SDK

    New

    • init({ defaultProperties }) now allows setting default properties that are stamped on every track() call. The browser SDK reads the device timezone at initialization, and page context includes URL and path per event, with referrer and UTM parameters captured once at init.

    Fixed

    • Email redaction now correctly decodes only %40 in email addresses from page fields, preventing malformed escape errors and ensuring proper redaction.
    • An undefined event value no longer erases a default property, ensuring that undefined values are treated as absent.
  10. @togohq/sdk-browser 1.0.0

    The first stable release

    • Browser SDK

    Improved

    • Semantic versioning. The public API is now stable: from this version on, a breaking change ships only in a new major version.