Togo
Togo
Apply for the betaSign in

Changelog

@togohq/sdk-node changelog

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

  1. @togohq/sdk-node 2.5.0

    Version 2.5.0 introduces new limits on event and property names and improves serverless function warnings

    • Node.js SDK

    New

    • Event and Property Name Length: Event and property names can now be up to 255 characters, allowing for greater flexibility and compatibility with other tools.
    • Serverless Warning: A warning is now logged when the timer sends in a serverless function, helping to identify potential data loss issues.

    Improved

    • onError now includes the property name for reports about unusable names and cuts, providing more detailed error information.

    Fixed

    • Serverless Warning Logic: The serverless warning now requires two timer sends with no flush between, correcting previous behavior.
    • Memory Usage: Only the IDs of evicted events are held until they are reported, reducing memory usage during outages.
  2. @togohq/sdk-node 2.4.0

    Version 2.4.0 reports property names Togo cannot use

    • Node.js 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, and a property name starting with $ is now reported as property_reserved too.
  3. @togohq/sdk-node 2.2.0

    Version 2.2.0 updates error and diagnostic codes in `onError`, requiring changes to error handlers

    • Node.js SDK

    Breaking

    • BREAKING: onError codes envelope_too_many_properties and shutdown_undelivered are now envelope_properties_too_many and shutdown_flush_failed. Update handlers that switch on these names.

    Migration

    Update onError handlers to use the new error code names.

    Before
    onError((error) => {
      if (error.code === 'envelope_too_many_properties') {
        handleTooManyProperties();
      }
    });
    After
    onError((error) => {
      if (error.code === 'envelope_properties_too_many') {
        handleTooManyProperties();
      }
    });

    The old form stops working in 2.2.0.

  4. @togohq/sdk-node 2.1.0

    @togohq/sdk-node 2.1.0

    • Node.js 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. flush() waits for it. Pass it to your error tracker. Each error carries a code.
    • setPersonProperties({ email, name }, person) sets a person's email address and name through typed parameters. null removes one.

    Fixed

    • An empty or over-long event name is dropped on its own, instead of with the whole batch it was in.

    Migration

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

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

    The old form stops working in 2.1.0.

  5. @togohq/sdk-node 2.0.0

    Version 2.0.0 introduces experiment tracking and removes custom session ID support

    • Node.js SDK

    Breaking

    • Custom session ID support via init({ sessionId }) and SessionIdMode 'custom' is removed.

    New

    • getExperiment() is now available for experiment tracking, sending $experiment_entered events.

    Improved

    • The SDK now forwards session IDs from the browser's getSessionId() only, without sending $session_started.

    Fixed

    • The reserved-name log in the Node SDK now correctly follows other drops, and non-string names are logged.

    Migration

    Replace custom session ID usage with ordinary event properties.

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

    The old form stops working in 2.0.0.

  6. @togohq/sdk-node 1.3.1

    Version 1.3.1 corrects the 1.3.0 changelog

    • Node.js SDK

    Fixed

    • The 1.3.0 entry in this changelog now describes the Node SDK's changes: withFlush(), flushIntervalSeconds replacing flushIntervalMs, the batchSize range and the flush() retry. It had listed browser-only session changes.
  7. @togohq/sdk-node 1.3.0

    Version 1.3.0 adds withFlush() for serverless handlers and takes the flush interval in seconds

    • Node.js SDK

    Breaking

    • flushIntervalSeconds (10 to 60, default 10) replaces flushIntervalMs. A flushIntervalMs passed to init() is ignored, with a warning naming the replacement.

    New

    • withFlush(handler) wraps a serverless handler so the queue is sent after it returns or throws, with its result passed through unchanged.

    Improved

    • batchSize accepts 100 to 500. A value outside that range is moved into it, with a warning.
    • flush() retries a network failure or a server error within a 2-second budget before it resolves, and never retries a 429.

    Migration

    Replace flushIntervalMs with flushIntervalSeconds, and wrap serverless handlers in withFlush().

    Before
    const analytics = init({ writeKey, flushIntervalMs: 10_000 });
    After
    const analytics = init({ writeKey, flushIntervalSeconds: 10 });
    export const handler = analytics.withFlush(async (event) => {
      analytics.track('order_paid', {}, { userId: event.userId });
    });

    The old form stops working in 1.3.0.

  8. @togohq/sdk-node 1.2.0

    This version introduces event ID returns and updates terminology for event definitions

    • Node.js SDK

    Breaking

    • Terminology updated: "declare" and "contract" are now "define" and "definition" across the SDK, aligning with internal naming conventions.

    New

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

    Migration

    Update code to use the new terminology for event definitions.

    Before
    declareEvent(); // uses 'declare' terminology
    After
    defineEvent(); // uses 'define' terminology

    The old form stops working in 1.2.0.

  9. @togohq/sdk-node 1.0.0

    The first stable release

    • Node.js SDK

    Improved

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