Skip to content

v1.0.0

Compare
Choose a tag to compare
@kelvin-lu kelvin-lu released this 25 Sep 22:11

A major release of the Amplitude Node SDK!

@amplitude/node:

  • Addition of the Transport class and interface
    • Guarantees that event payloads are sent one by one, in order.
  • Addition of the RetryClass class and RetryHandler interface.
    • Attempts to retry failed transport events when appropriate (network instability, server errors, device throttling)
    • Uses the Response of the HTTP v2 API to further inform which events should and should not be retried.
    • A focus on making sure that events are sent in the correct order and that device/user throttling affects as few events as possible
  • Ability to extend and override above classes in the base SDK
  • Implementation of the flush function and turns on batching of events into larger payloads by default

@amplitude/types:

  • Addition of Response and Status types that describe the result of a request to the Amplitude HTTP v2 API
    • Helper utilities to parse the information from a request, with the assumption that we are pointed to the HTTP v2 endpoint.
  • Addition of the RetryClass and Transport interfaces, two abstraction layers for helping the Node Client maintain correctness and reliability.
  • Increased optioning on the Option type (see docs for more info):
    • debug (boolean): Whether or not to start the SDK in debug mode, turning on message logs.
    • logLevel (number): The verbosity level of messages in the SDK.
    • maxCachedEvents (number): The number of events to store before flushing.
    • maxRetries (number): The number of times the base retryClass will retry a given event before giving up and dropping.
    • retryClass (RetryClass): An instance that implements sendEventsWithRetry function, used to override our retrying mechanisms.
    • transportClass (Transport): An instance that implements the sendPayload function, used to override the Transport Layer.
    • uploadIntervalInSec (number): The number of seconds to set a timeout for after logging an event to flush all batched events. 0 by default (flushes on the next event loop).

@amplitude/utils:

  • Utilities to help Amplitude log safely in multiple environments
    • Utilities to help Amplitude configure the level at which it logs messages
  • Utilities to help collect information off of response bodies from the HTTP V2 API.