This class provides utility functions for parsing and handling identity from Amplitude cookies.

Hierarchy

  • AmplitudeCookie

Constructors

Methods

Constructors

Methods

  • Returns

    The cookie name that Amplitude sets for the provided Amplitude API Key

    Parameters

    • amplitudeApiKey: string

      The Amplitude API Key

    • newFormat: boolean = false

      True if the cookie is in the Browser SDK 2.0 format

    Returns string

  • Generates a cookie string to set for the Amplitude Javascript SDK

    Returns

    A cookie string to set for the Amplitude Javascript SDK to read

    Parameters

    • deviceId: string

      A device id to set

    • newFormat: boolean = false

      True if the cookie is in the Browser SDK 2.0 format

    Returns string

  • Returns

    a ExperimentUser context containing a device_id and user_id (if available)

    Parameters

    • amplitudeCookie: string

      A string from the amplitude cookie

    • newFormat: boolean = false

      True if the cookie is in the Browser SDK 2.0 format

    Returns ExperimentUser