Package detail

@rudderstack/analytics-js

rudderlabs500.2kElastic-2.03.21.0

RudderStack JavaScript SDK

analytics, rudder

readme

Releases TypeScript Quality Gate Status Maintainability Rating Reliability Rating Security Rating Coverage

RudderStack
The Customer Data Platform for Developers

Website · Documentation · Community Slack


RudderStack JavaScript SDK

The JavaScript SDK lets you track customer event data from your website and send it to your specified destinations via RudderStack.

For detailed documentation on the RudderStack JavaScript SDK, click here.

Table of Contents

IMPORTANT: The service worker export has been deprecated from the RudderStack JavaScript SDK NPM package and moved to a new package.
If you still wish to use it for your project, see @rudderstack/analytics-js-service-worker package.

Installing the JavaScript SDK

For detailed installation steps, see the JavaScript SDK documentation.

Using CDN

See CDN installation for detailed steps.

To load SDK script on to your page synchronously, see the JavaScript SDK documentation.

IMPORTANT: The implicit page call at the end of the snippet (present in the previous JavaScript SDK versions) is removed in the latest SDK (v3). You need to make a page call explicitly, if required, as shown below:

rudderanalytics.page();

Using NPM

Although we recommend using the CDN installation method to use the JavaScript SDK with your website, you can also use this NPM module to package RudderStack directly into your project.

To install the SDK via NPM, run the following command:

npm install @rudderstack/analytics-js --save

Note that this NPM module is only meant to be used for a browser installation. If you want to integrate RudderStack with your Node.js application, see the RudderStack Node.js documentation.

IMPORTANT: Since the module exports the related APIs on an already-defined object combined with the Node.js module caching, you should run the following code snippet only once and use the exported object throughout your project:

  • For ECMAScript modules (ESM):
import { RudderAnalytics } from '@rudderstack/analytics-js';

const rudderAnalytics = new RudderAnalytics();
rudderAnalytics.load(<WRITE_KEY>, <DATA_PLANE_URL>, {});

export { rudderAnalytics };
  • For CJS using the require method:
var RudderAnalytics = require('@rudderstack/analytics-js');

const rudderAnalytics = new RudderAnalytics();
rudderAnalytics.load(<WRITE_KEY>, <DATA_PLANE_URL>, {});

exports.rudderAnalytics = rudderAnalytics;

Sample implementations

See the following applications for a detailed walkthrough of the above steps:

See the examples directory in this repository for more sample applications for different frameworks.

Migrating SDK from an older version

If you are migrating the JavaScript SDK from an older version (<= v1.1), see the Migration Guide for details.

Loading the SDK

For detailed information on the load API, see the JavaScript SDK documentation.

You can load the JavaScript SDK using the load API to track and send events from your website to RudderStack. Make sure to replace the write key and data plane URL with their actual values.

rudderanalytics.load(<WRITE_KEY>, <DATA_PLANE_URL>, [loadOptions]);

You can use the loadOptions object in the above load call to define various options while loading the SDK.

Identifying users

The identify API lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.

A sample identify call is shown below:

rudderanalytics.identify(
  '1hKOmRA4el9Zt1WSfVJIVo4GRlm',
  {
    firstName: 'Alex',
    lastName: 'Keener',
    email: 'alex@example.com',
    phone: '+1-202-555-0146',
  },
  {
    page: {
      path: '/best-seller/1',
      referrer: 'https://www.google.com/search?q=estore+bestseller',
      search: 'estore bestseller',
      title: 'The best sellers offered by EStore',
      url: 'https://www.estore.com/best-seller/1',
    },
  },
  () => {
    console.log('Identify call is successful.');
  },
);

In the above example, the JavaScript SDK captures the user information like userId, firstName, lastName, email, and phone, along with the default contextual information.

There is no need to call identify API for anonymous visitors to your website. Such visitors are automatically assigned an anonymousId.

See the JavaScript SDK documentation for more information on how to use the identify API.

Tracking user actions

The track API lets you capture the user events along with any associated properties.

A sample track API is shown below:

rudderanalytics.track(
  'Order Completed',
  {
    revenue: 30,
    currency: 'USD',
    user_actual_id: 12345,
  },
  () => {
    console.log('Track call is successful.');
  },
);

In the above example, the track API tracks the user event Order Completed and information like the revenue, currency, etc.

You can use the track API to track various success metrics for your website like user signups, item purchases, article bookmarks, and more.

Ready state

There are cases when you may want to tap into the features provided by the end-destination SDKs to enhance tracking and other functionalities. The JavaScript SDK exposes a ready API with a callback parameter that fires when the SDK is done initializing itself and the device-mode destinations.

An example is shown in the following snippet:

rudderanalytics.ready(() => {
  console.log('We are all set!!!');
});

Loaded state

Alternatively, if you just want to wait for the SDK to load, you can use the onLoaded load API option to configure a callback function.

The configured callback function is executed when the SDK has loaded successfully but before all the device-mode destinations are initialized.

This is especially helpful to query information from the SDK after it has loaded to use it elsewhere. For example, you can retrieve the anonymous ID generated by the SDK after it has loaded.

An example is shown in the following snippet:

rudderanalytics.load(<WRITE_KEY>, <DATA_PLANE_URL>, {
  onLoaded: () => {
    console.log('SDK has loaded.');
    console.log('Anonymous ID:', rudderanalytics.getAnonymousId());
  },
});

For more information on the other supported methods, see the JavaScript SDK APIs.

Self-hosted control plane

Control Plane Lite is now deprecated. It will not work with the latest rudder-server versions (after v1.2). Using RudderStack Open Source to set up your control plane is strongly recommended.

If you are self-hosting the control plane using the Control Plane Lite utility, your load call will look like the following:

rudderanalytics.load(<WRITE_KEY>, <DATA_PLANE_URL>, {
  configUrl: <CONTROL_PLANE_URL>,
});

More information on obtaining the CONTROL_PLANE_URL can be found here.

How to build the SDK

  • Look for run scripts in the package.json file for getting the browser minified and non-minified builds. The builds are updated in the dist folder of the directory. Among the others, some of the important ones are:

    • npm run build:browser: This outputs the dist/cdn/legacy/rsa.min.js.
    • npm run build:npm: This outputs the dist/npm folder that contains the NPM package contents.
    • npm run build:integration:all: This outputs the dist/cdn/legacy folder that contains the integrations.

We use rollup to build our SDKs. The configuration for it is present in the rollup-configs directory.

  • For adding or removing integrations, modify the imports in index.js under the src/integrations folder.

Usage in Chrome extensions

You can use the JavaScript SDK in Chrome Extensions with manifest v3, both as a content script (via the JavaScript SDK package) or as a background script service worker (via the service worker package).

For more details, see Chrome Extensions Usage.

Usage in Serverless runtimes

RudderStack JS SDK service worker can be used in serverless runtimes like Cloudflare Workers or Vercel Edge functions.

For more details, see:

License

This project is licensed under the Elastic License 2.0. See the LICENSE.md file for details. Review the license terms to understand your permissions and restrictions.

If you have any questions about licensing, please contact us or refer to the official Elastic licensing page.

Contribute

We encourage contributions to this project. For detailed guidelines on how to contribute, please refer to here.

Contact us

For more information on any of the sections covered in this readme, you can contact us or start a conversation on our Slack channel.

Follow Us

:clap: Our Supporters

Stargazers repo roster for @rudderlabs/rudder-sdk-js

Forkers repo roster for @rudderlabs/rudder-sdk-js

changelog

Changelog

This file was generated using @jscutlery/semver.

3.21.0 (2025-06-20)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.27
  • @rudderstack/analytics-js-common updated to version 3.21.0
  • @rudderstack/analytics-js-plugins updated to version 3.10.2

Features

  • analytics-js: reduce error noise from CSP/adblocker (#2296) (c187816)

3.20.1 (2025-06-12)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.10.1

    3.20.0 (2025-06-11)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.26
  • @rudderstack/analytics-js-common updated to version 3.20.0
  • @rudderstack/analytics-js-plugins updated to version 3.10.0

Features

  • add support to dynamically override destinations status (#2266) (5af2f22)
  • dynamically clone destinations (#2276) (f136454)
  • enable destination config override (#2267) (c570106)
  • enhance retry headers with RSA-prefixed naming (#2279) (c25b2bc)
  • set proper grouping hash for all errors (#2246) (430c497)

3.19.0 (2025-06-03)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.9.0

Features

  • retry delivery failures in beacon plugin when page is unloaded (#2269) (cec81f3)

3.18.2 (2025-05-26)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.8.4

Bug Fixes

  • store events in in-progress queue even when the page is unloaded (#2245) (8f978b5)

3.18.1 (2025-05-14)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.8.3

Bug Fixes

  • store events in in-progress queue even when the page is unloaded (#2245) (843db54)

3.18.0 (2025-05-09)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.25
  • @rudderstack/analytics-js-common updated to version 3.19.0
  • @rudderstack/analytics-js-plugins updated to version 3.8.2

Features

Bug Fixes

  • load api options boolean inputs normalization (#2236) (4c3532c)

3.17.0 (2025-04-25)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.24
  • @rudderstack/analytics-js-common updated to version 3.18.0
  • @rudderstack/analytics-js-plugins updated to version 3.8.1

Features

  • pre-consent event buffering works now for anonymousId pre-consent storage strategy (#2100) (6336925)
  • remove page loaded event (#2088) (ec1d604)

Bug Fixes

  • consent api race condition to load integrations (#2178) (30149ad)
  • consider local page urls as dev release stage in error reporting (#2174) (ae53449)
  • recursively migrate persisted entries (#2187) (3dd07ea)
  • rename view id to visit id (#2086) (51c8dd9)
  • rename visit duration to time on page (#2087) (569846d)

3.16.1 (2025-03-03)

Bug Fixes

  • prevent cookie storage engine options init by default (#2077) (cf0e4d9)

3.16.0 (2025-03-03)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.23
  • @rudderstack/analytics-js-common updated to version 3.17.2
  • @rudderstack/analytics-js-plugins updated to version 3.8.0

Features

Bug Fixes

  • avoid premature execution before sdk initialization (#2056) (9c7e2a6)
  • handle edge cases in retry queue (#2074) (f9263b2)

3.15.2 (2025-02-24)

Bug Fixes

3.15.1 (2025-02-20)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.22
  • @rudderstack/analytics-js-common updated to version 3.17.1
  • @rudderstack/analytics-js-plugins updated to version 3.7.2

Bug Fixes

  • consent api to refresh consent data every time (#2052) (0cf0f9a)
  • retry status code logic and error messages (#2050) (28fd410)
  • sdk loading snippet to reduce ambiguity in updating url (#2048) (843d944)

3.15.0 (2025-02-17)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.21
  • @rudderstack/analytics-js-common updated to version 3.17.0
  • @rudderstack/analytics-js-plugins updated to version 3.7.1

Features

3.14.0 (2025-01-31)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.20
  • @rudderstack/analytics-js-common updated to version 3.16.0
  • @rudderstack/analytics-js-plugins updated to version 3.7.0

Features

3.13.0 (2025-01-28)

Features

  • lock plugins and integrations versions for npm package (#2020) (447e524)
    • Plugins and integration SDKs will now be loaded from a versioned directory (/3.x.y/) on the CDN instead of the common /v3/ path.
    • This ensures that SDK updates do not unexpectedly break existing integrations due to changes in dependencies.
    • If you are using a CDN proxy, ensure that it does not block requests to versioned paths like /3.13.0/, otherwise the SDK will not load correctly.

3.12.0 (2025-01-24)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.19
  • @rudderstack/analytics-js-common updated to version 3.15.0
  • @rudderstack/analytics-js-plugins updated to version 3.6.22

Features

  • lock plugins and integrations version by default (#1956) (45e716e)
    • Plugins and integration SDKs will now be loaded from a versioned directory (/3.x.y/) on the CDN instead of the common /v3/ path.
    • This ensures that SDK updates do not unexpectedly break existing integrations due to changes in dependencies.
    • If you are using a CDN proxy, ensure that it does not block requests to versioned paths like /3.13.0/, otherwise the SDK will not load correctly.

3.11.17 (2025-01-03)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.18
  • @rudderstack/analytics-js-common updated to version 3.14.15
  • @rudderstack/analytics-js-plugins updated to version 3.6.21

    3.11.16 (2024-12-17)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.17
  • @rudderstack/analytics-js-common updated to version 3.14.14
  • @rudderstack/analytics-js-plugins updated to version 3.6.20

Bug Fixes

  • remove circular dependency in packages (#1973) (e525496)
  • separator and make changes in bugsnag plugin (b69347c)

3.11.15 (2024-12-06)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.16
  • @rudderstack/analytics-js-common updated to version 3.14.13
  • @rudderstack/analytics-js-plugins updated to version 3.6.18

    3.11.14 (2024-11-30)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.6.17

Bug Fixes

  • preload events not processed with detached load call (#1953) (6b0f66f)

3.11.13 (2024-11-22)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.15
  • @rudderstack/analytics-js-common updated to version 3.14.12
  • @rudderstack/analytics-js-plugins updated to version 3.6.16

    3.11.12 (2024-11-22)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.14
  • @rudderstack/analytics-js-common updated to version 3.14.11
  • @rudderstack/analytics-js-plugins updated to version 3.6.15

    3.11.11 (2024-11-22)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.13
  • @rudderstack/analytics-js-common updated to version 3.14.10
  • @rudderstack/analytics-js-plugins updated to version 3.6.14

Bug Fixes

  • restore data sanitization changes but avoid using api overloads (d0913ae)

3.11.10 (2024-11-22)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.12
  • @rudderstack/analytics-js-common updated to version 3.14.9
  • @rudderstack/analytics-js-plugins updated to version 3.6.13

    3.11.9 (2024-11-22)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.11
  • @rudderstack/analytics-js-common updated to version 3.14.8
  • @rudderstack/analytics-js-plugins updated to version 3.6.12

    3.11.8 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.10
  • @rudderstack/analytics-js-common updated to version 3.14.7
  • @rudderstack/analytics-js-plugins updated to version 3.6.11

    3.11.7 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.9
  • @rudderstack/analytics-js-common updated to version 3.14.6
  • @rudderstack/analytics-js-plugins updated to version 3.6.10

Bug Fixes

3.11.6 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.8
  • @rudderstack/analytics-js-common updated to version 3.14.5
  • @rudderstack/analytics-js-plugins updated to version 3.6.9

    3.11.5 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.7
  • @rudderstack/analytics-js-common updated to version 3.14.4
  • @rudderstack/analytics-js-plugins updated to version 3.6.8

    3.11.4 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.6
  • @rudderstack/analytics-js-common updated to version 3.14.3
  • @rudderstack/analytics-js-plugins updated to version 3.6.7

    3.11.3 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.5
  • @rudderstack/analytics-js-common updated to version 3.14.2
  • @rudderstack/analytics-js-plugins updated to version 3.6.6

    3.11.2 (2024-11-21)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.6.4

    3.11.1 (2024-11-19)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.4
  • @rudderstack/analytics-js-common updated to version 3.14.1
  • @rudderstack/analytics-js-plugins updated to version 3.6.4

    3.11.0 (2024-11-18)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.3
  • @rudderstack/analytics-js-common updated to version 3.14.0
  • @rudderstack/analytics-js-plugins updated to version 3.6.3

Features

  • error handle public apis (295793a)

3.10.2 (2024-11-18)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.2
  • @rudderstack/analytics-js-common updated to version 3.13.0
  • @rudderstack/analytics-js-plugins updated to version 3.6.2

    3.10.1 (2024-11-12)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.1
  • @rudderstack/analytics-js-common updated to version 3.12.1
  • @rudderstack/analytics-js-plugins updated to version 3.6.1

Bug Fixes

3.10.0 (2024-11-08)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.4.0
  • @rudderstack/analytics-js-common updated to version 3.12.0
  • @rudderstack/analytics-js-plugins updated to version 3.6.0

Features

3.9.1 (2024-11-07)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.14
  • @rudderstack/analytics-js-common updated to version 3.11.1
  • @rudderstack/analytics-js-plugins updated to version 3.5.2

Bug Fixes

3.9.0 (2024-10-25)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.13
  • @rudderstack/analytics-js-common updated to version 3.11.0
  • @rudderstack/analytics-js-plugins updated to version 3.5.1

Features

3.8.0 (2024-10-21)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.12
  • @rudderstack/analytics-js-common updated to version 3.10.0
  • @rudderstack/analytics-js-plugins updated to version 3.5.0

Features

3.7.19 (2024-10-18)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.11
  • @rudderstack/analytics-js-common updated to version 3.9.5
  • @rudderstack/analytics-js-plugins updated to version 3.4.19

Bug Fixes

  • harmless change in the core sdk package (5c34b04)

3.7.18 (2024-10-17)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.10
  • @rudderstack/analytics-js-common updated to version 3.9.4
  • @rudderstack/analytics-js-plugins updated to version 3.4.18

    3.7.17 (2024-10-11)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.4.16

Bug Fixes

  • global integrations object is not used for preloaded events (#1881) (2776f07)

3.7.16 (2024-10-10)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.4.15

Bug Fixes

  • source config fixture and local storage issue (cbf0833)

3.7.15 (2024-10-03)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.4.15

Bug Fixes

  • storage access error when cookies are blocked (#1872) (966dbc2)

3.7.14 (2024-09-27)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.9
  • @rudderstack/analytics-js-common updated to version 3.9.3
  • @rudderstack/analytics-js-plugins updated to version 3.4.14

Bug Fixes

  • add explicit checking for setting user and group traits (68b4293)
  • auto session tracking (#1856) (fa7cce4)
  • upgrade all packages to latest to fix vulnerabilities (#1867) (389348c)

3.7.13 (2024-09-17)

Bug Fixes

3.7.12 (2024-09-12)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.8
  • @rudderstack/analytics-js-common updated to version 3.9.2
  • @rudderstack/analytics-js-plugins updated to version 3.4.12

Bug Fixes

  • gracefully handle cross sdk version cookies and warn (#1847) (408a838)

3.7.11 (2024-08-30)

Bug Fixes

3.7.10 (2024-08-28)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.7
  • @rudderstack/analytics-js-common updated to version 3.9.1
  • @rudderstack/analytics-js-plugins updated to version 3.4.10

Bug Fixes

  • handle blur and focus events to detect page leave (#1837) (57e735c)

3.7.9 (2024-08-16)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.6
  • @rudderstack/analytics-js-common updated to version 3.9.0
  • @rudderstack/analytics-js-plugins updated to version 3.4.9

    3.7.8 (2024-08-16)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.4.8

    3.7.7 (2024-08-02)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 0.3.5
  • @rudderstack/analytics-js-common updated to version 3.8.1
  • @rudderstack/analytics-js-plugins updated to version 3.4.7

Bug Fixes

3.7.6 (2024-07-24)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.7.5
  • @rudderstack/analytics-js-common updated to version 3.7.5
  • @rudderstack/analytics-js-plugins updated to version 3.7.5

    3.7.5 (2024-07-23)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.7.4

Bug Fixes

3.7.4 (2024-07-23)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.7.3

Bug Fixes

3.7.3 (2024-07-23)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.7.2

Bug Fixes

3.7.2 (2024-07-22)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.7.1

Bug Fixes

  • exclude capturing promise rejection error (#1794) (c006035)

3.7.1 (2024-07-22)

Bug Fixes

3.7.0 (2024-07-19)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.6.1
  • @rudderstack/analytics-js-common updated to version 3.6.1
  • @rudderstack/analytics-js-plugins updated to version 3.6.1

Features

Bug Fixes

3.6.1 (2024-07-05)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.6.0
  • @rudderstack/analytics-js-common updated to version 3.6.0
  • @rudderstack/analytics-js-plugins updated to version 3.6.0

Bug Fixes

3.6.0 (2024-07-04)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.5.2
  • @rudderstack/analytics-js-common updated to version 3.5.2
  • @rudderstack/analytics-js-plugins updated to version 3.5.2

Features

  • update itp implementation based on load options (#1777) (75aa117)

3.5.2 (2024-07-01)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.5.1
  • @rudderstack/analytics-js-plugins updated to version 3.5.1

    3.5.1 (2024-06-25)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.5.0
  • @rudderstack/analytics-js-plugins updated to version 3.5.0

    3.5.0 (2024-06-25)

Dependency Updates

  • @rudderstack/analytics-js-cookies updated to version 3.4.0
  • @rudderstack/analytics-js-plugins updated to version 3.4.0

Features

3.4.0 (2024-06-21)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.3.0
  • @rudderstack/analytics-js-plugins updated to version 3.3.0

Features

Bug Fixes

3.3.0 (2024-06-07)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.2.2
  • @rudderstack/analytics-js-plugins updated to version 3.2.2

Features

Bug Fixes

3.2.2 (2024-06-04)

Bug Fixes

  • sync issues between state and storage for session info (#1742) (3eddf30)

3.2.1 (2024-05-29)

Bug Fixes

3.2.0 (2024-05-24)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.1.1
  • @rudderstack/analytics-js-plugins updated to version 3.1.1

Features

Bug Fixes

3.1.1 (2024-05-10)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.1.0

    3.1.0 (2024-04-26)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.0.4
  • @rudderstack/analytics-js-plugins updated to version 3.0.4

Features

  • add a patch for storejs to expose length of the store (#1694) (36a13b0)
  • warn users on missing plugins (#1691) (c57cf82)

3.0.4 (2024-04-12)

Bug Fixes

  • remove MutationObserver and make polyfill checks consistent (#1688) (51b42fe)
  • remove unnecessary window globals declarations (#1687) (09e5ab8)

3.0.3 (2024-03-22)

Dependency Updates

  • @rudderstack/analytics-js-plugins updated to version 3.0.2

    3.0.2 (2024-03-22)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.0.1
  • @rudderstack/analytics-js-plugins updated to version 3.0.1

Bug Fixes

3.0.1 (2024-03-21)

Dependency Updates

  • @rudderstack/analytics-js-common updated to version 3.0.0
  • @rudderstack/analytics-js-plugins updated to version 3.0.0

    3.0.0-beta.24 (2024-03-18)

3.0.0-beta.23 (2024-03-01)

Features

  • fetch anonymous id by cookie name provided in load option (#1625) (d8ccb10)
  • reserved elements list updated (#1632) (20417fa)

Bug Fixes

  • analytics-js-loading-scripts: add version in polyfill io url (#1630) (3e315a6)
  • rudder-sdk-js: updated component-emitter to latest, supporting TS (#1626) (ffc0f24)

3.0.0-beta.22 (2024-02-16)

3.0.0-beta.21 (2024-02-02)

Features

  • analytics-js: auto expose new instance to window.rudderanalytics for npm usage (#1599) (27000ec)
  • analytics-js: change default value of storage migrate flag to true (#1602) (6349436)

3.0.0-beta.20 (2024-01-19)

Features

3.0.0-beta.19 (2024-01-08)

Bug Fixes

3.0.0-beta.18 (2023-12-13)

Bug Fixes

  • analytics-js: new export that excludes all third party host scripts (#1533) (999d8fa)

3.0.0-beta.17 (2023-12-06)

Bug Fixes

  • analytics-js: post ready callback invocations (#1535) (996fb9a)

3.0.0-beta.16 (2023-12-01)

Features

  • analytics-js-loading-scripts: add loading snippet version in event context (#1483) (4873cbc)

Bug Fixes

3.0.0-beta.15 (2023-11-13)

Features

Bug Fixes

3.0.0-beta.14 (2023-10-27)

Features

Bug Fixes

  • analytics-js: correct declared global extended type (#1460) (3f15290)
  • analytics-js: fix remote import error when npm package is bundled with webpack (#1466) (3a818ac)
  • monorepo: update vulnerable dependencies (#1457) (7a4bc4c)
  • upgrade vulnerable cryptoJS dependency, rolup to v4 & NX to v17 (#1471) (b2bb21c)

3.0.0-beta.13 (2023-10-16)

Features

  • add support for session storage (#1440) (7e3106b)
  • analytics-js-service-worker: deprecate service worker export of rudder-sdk-js package in favor of the new standalone package(#1437) (1797d3e)
  • dmt plugin for v3 (#1412) (97ee68a)

Bug Fixes

  • analytics-js-loading-scripts: add globalThis polyfill for safari (#1446) (bf111f8)
  • analytics-js: add global definitions extended window type (#1445) (b995635)
  • empty anonymous id after reset call (#1433) (b078347)
  • identify traits type (#1427) (a58c919)
  • pass anonymous id load option to getanonymousid method (#1443) (e234a8f)

3.0.0-beta.12 (2023-10-02)

Bug Fixes

  • analytics-js,rudder-sdk-js: dead object issue (#1410) (94f4b2d)

3.0.0-beta.11 (2023-09-26)

Bug Fixes

  • analytics-js-plugins: add IE11 compatibility for crypto-es (#1407) (483ae44)

3.0.0-beta.10 (2023-09-26)

Features

Bug Fixes

  • analytics-js: enforce default cloud mode events delivery plugin (#1402) (e06d9b8)
  • plugins registering twice (#1380) (9de8f28)

3.0.0-beta.9 (2023-09-20)

3.0.0-beta.8 (2023-09-18)

Features

  • deprecate support of common names for integrations (#1374) (f1d097d)

3.0.0-beta.7 (2023-09-14)

Features

  • granular control of persisted data storing with auto migration (#1329) (b709edc)
  • new load options for pre-consent configuration (#1363) (363a524)

Bug Fixes

  • getsessionid updating the sessionstart status (#1370) (510bb06)

3.0.0-beta.6 (2023-08-30)

Bug Fixes

  • forward only supported calls to the log provider (#1333) (a4c0743)
  • handle errors for cookies data URI encode and decode (#1350) (b25ff6c)

Features

3.0.0-beta.5 (2023-08-21)

Bug Fixes

  • analytics-js: update context page details in every event creation (#1317) (45c2300)

3.0.0-beta.4 (2023-08-17)

Bug Fixes

  • analytics-js: fix SPA url change not reflecting in context page (22c13bf)

3.0.0-beta.3 (2023-08-10)

Bug Fixes

  • analytics-js: add polyfill and feature detection for CustomEvent (92c565f)
  • analytics-js: change default cdn paths to the beta ones (8d4bbe4)

3.0.0-beta.2 (2023-08-09)

Bug Fixes

  • add missing load option to buffer data plane events (#1265) (8bca1b2)
  • analytics-js: add new flag in errorHandler, add state reset method (#998) (4c76315)
  • analytics-js: data residency url detection issue (#1163) (4e80937)
  • analytics-js: fix edge cases & add unit tests for error handler (068f305)
  • analytics-js: fix issues with tracking methods overloads (#1164) (718f9a9)
  • analytics-js: fix type issues & broken unit tests (dd198bc)
  • analytics-js: support imports in SSR & reduce shared bundles code (#1135) (29d1d75)
  • auto capture anonymous id (#1160) (2947ead)
  • auto detection of destSDKBaseUrl (#1144) (1d6a1d7)
  • avoid persisting user id in alias api (#1057) (273eb9e)
  • config url deduction (#1282) (658dc24)
  • cookie storage options (#1232) (23970bc)
  • error reporting (#1285) (1b9324e)
  • ie11 incompatibility issues (#1279) (80c59ae)
  • issues in rudder event structure (#1111) (bed6210)
  • issues post sanity checks, tidy up code structure, add uaCH, npm packaging (#1132) (0fa64c1)
  • native destinations queue options (#1209) (0341fc8)
  • normalize all error messages (#1191) (b45f3f3)
  • storage option configuration (#1217) (7dc0488)
  • use destination display name throughout the app (#1269) (6e6a18c)
  • xhr queue plugin retry mechanism (#1171) (6d8d2b9)

Features

Change Log