Togo
Togo
Apply for the beta

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 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.
  2. @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.

  3. @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.

  4. @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.