@rudderstack/analytics-js 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [3.4.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.3.0...@rudderstack/analytics-js@3.4.0) (2024-06-21)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@rudderstack/analytics-js-common` updated to version `3.3.0`
10
+ * `@rudderstack/analytics-js-plugins` updated to version `3.3.0`
11
+
12
+ ### Features
13
+
14
+ * add the ability to lock plugins version ([#1749](https://github.com/rudderlabs/rudder-sdk-js/issues/1749)) ([e2e1620](https://github.com/rudderlabs/rudder-sdk-js/commit/e2e1620677c90169fca35ed3e9057ced3b88a299))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * add state metadata even for unhandled errors ([#1755](https://github.com/rudderlabs/rudder-sdk-js/issues/1755)) ([66fc415](https://github.com/rudderlabs/rudder-sdk-js/commit/66fc415474ffccd684972b47f9926ab87c0a514c))
20
+ * debounce cookie requests to server ([#1752](https://github.com/rudderlabs/rudder-sdk-js/issues/1752)) ([8b25cbe](https://github.com/rudderlabs/rudder-sdk-js/commit/8b25cbea43274f71825986c0ce78919358ce5b15))
21
+ * improve flushing events on page leave ([#1754](https://github.com/rudderlabs/rudder-sdk-js/issues/1754)) ([1be420f](https://github.com/rudderlabs/rudder-sdk-js/commit/1be420fae16b68629789d2ba37e16e6a6e00017c))
22
+ * remove data residency feature ([#1748](https://github.com/rudderlabs/rudder-sdk-js/issues/1748)) ([870a7ec](https://github.com/rudderlabs/rudder-sdk-js/commit/870a7ecf3cd251d88c207d9815c2f16c6e9a6883))
23
+
24
+ ## [3.3.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.2.2...@rudderstack/analytics-js@3.3.0) (2024-06-07)
25
+
26
+ ### Dependency Updates
27
+
28
+ * `@rudderstack/analytics-js-common` updated to version `3.2.2`
29
+ * `@rudderstack/analytics-js-plugins` updated to version `3.2.2`
30
+
31
+ ### Features
32
+
33
+ * add install type to context ([#1740](https://github.com/rudderlabs/rudder-sdk-js/issues/1740)) ([3d25b65](https://github.com/rudderlabs/rudder-sdk-js/commit/3d25b654a70b0f39c412e80465e29e2bdb578aa7))
34
+ * handle remove cookie from client side ([#1739](https://github.com/rudderlabs/rudder-sdk-js/issues/1739)) ([8b19932](https://github.com/rudderlabs/rudder-sdk-js/commit/8b19932a702e1319cce6fa09961d109f0a83f71c))
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * abort initialization if source is disabled ([#1737](https://github.com/rudderlabs/rudder-sdk-js/issues/1737)) ([682b748](https://github.com/rudderlabs/rudder-sdk-js/commit/682b74873fa9d57ca5033e73a1d69f50b846523e))
40
+ * cookie domain determination ([#1735](https://github.com/rudderlabs/rudder-sdk-js/issues/1735)) ([dbeb064](https://github.com/rudderlabs/rudder-sdk-js/commit/dbeb0649f5632409b6a8e8c8bb19260c85d09224))
41
+ * cookie value comparison ([#1736](https://github.com/rudderlabs/rudder-sdk-js/issues/1736)) ([1ffb763](https://github.com/rudderlabs/rudder-sdk-js/commit/1ffb7638af1e4b69ae87121ac7f29f9ea489558f))
42
+ * handle cross domain server-side cookie requests ([#1741](https://github.com/rudderlabs/rudder-sdk-js/issues/1741)) ([68a2d3b](https://github.com/rudderlabs/rudder-sdk-js/commit/68a2d3b025a45311cc3639b140d33a9659e93e8f))
43
+ * improve sdk loading snippet ([#1745](https://github.com/rudderlabs/rudder-sdk-js/issues/1745)) ([d4e0f66](https://github.com/rudderlabs/rudder-sdk-js/commit/d4e0f663a4d0cdb55563ed380166d55e99cf3fc8))
44
+ * url validation ([#1730](https://github.com/rudderlabs/rudder-sdk-js/issues/1730)) ([3a3e105](https://github.com/rudderlabs/rudder-sdk-js/commit/3a3e1057f2db91ef5cbf652a664db9443fee9843))
45
+
5
46
  ## [3.2.2](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.2.1...@rudderstack/analytics-js@3.2.2) (2024-06-04)
6
47
 
7
48
 
package/README.md CHANGED
@@ -34,7 +34,7 @@ RudderStack JavaScript SDK for browsers.
34
34
 
35
35
  ## Installing the package
36
36
 
37
- To install the package via npm, run the following command:
37
+ To install the package via NPM, run the following command:
38
38
 
39
39
  ```bash
40
40
  npm install @rudderstack/analytics-js --save
@@ -51,7 +51,6 @@ import { RudderAnalytics } from '@rudderstack/analytics-js';
51
51
 
52
52
  const analytics = new RudderAnalytics();
53
53
  analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
54
- window.rudderanalytics = analytics;
55
54
  ```
56
55
 
57
56
  Bundled export will contain the plugins code as part of the bundle in build time.
@@ -61,40 +60,35 @@ import { RudderAnalytics } from '@rudderstack/analytics-js/bundled';
61
60
 
62
61
  const analytics = new RudderAnalytics();
63
62
  analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
64
- window.rudderanalytics = analytics;
65
63
  ```
66
64
 
67
- Legacy export will contain the plugins code as part of the bundle in build time and support legacy browsers like IE11.
65
+ Legacy export will contain the plugins code as part of the bundle in build time and supports legacy browsers like IE11.
68
66
 
69
67
  ```javascript
70
68
  import { RudderAnalytics } from '@rudderstack/analytics-js/legacy';
71
69
 
72
70
  const analytics = new RudderAnalytics();
73
71
  analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
74
- window.rudderanalytics = analytics;
75
72
  ```
76
73
 
77
74
  ## How to build the SDK
78
75
 
79
- Look for run scripts in the `package.json` file for getting the browser minified and non-minified builds. The builds are
80
- updated in the `dist` folder of the directory. Among the others, some of the important ones are:
76
+ 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:
81
77
 
82
- - `npm run build:browser:modern`: This outputs **dist/cdn/modern** folder that contains the cdn package contents.
83
- - `npm run build:npm`: This outputs **dist/npm** folder that contains the npm package contents.
78
+ - `npm run build:browser:modern`: This outputs **dist/cdn/modern** folder that contains the CDN package contents.
79
+ - `npm run build:npm`: This outputs **dist/npm** folder that contains the NPM package contents.
84
80
 
85
81
  ## Usage in Chrome Extensions
86
82
 
87
- RudderStack JS SDK can be used in Chrome Extensions with manifest v3, both as a content script (via the JavaScript SDK package)
88
- or as a background script service worker (via the [service worker package](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker)).
83
+ RudderStack JS SDK can be used 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](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker)).
89
84
 
90
- For examples and specific details look into [Chrome Extensions Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/chrome-extension/USAGE.md)
85
+ For more details, see [Chrome Extensions Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/chrome-extension/USAGE.md).
91
86
 
92
87
  ## Usage in Serverless Runtimes
93
88
 
94
- RudderStack JS SDK [service worker](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker) can be used
95
- in serverless runtimes like Cloudflare Workers or Vercel Edge functions.
89
+ RudderStack JS SDK [service worker](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker) can be used in serverless runtimes like Cloudflare Workers or Vercel Edge functions.
96
90
 
97
- For examples and specific details look into:
91
+ For more details, see:
98
92
 
99
93
  - [Vercel Edge Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)
100
94
  - [Cloudflare Worker Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)
@@ -85,11 +85,6 @@ type APIEvent = {
85
85
  };
86
86
  type RudderEventType = 'page' | 'track' | 'identify' | 'alias' | 'group';
87
87
 
88
- /**
89
- * Represents residency server input the options
90
- */
91
- type ResidencyServerRegion = 'US' | 'EU';
92
-
93
88
  interface ExtensionPoint {
94
89
  [lifeCycleName: string]: (...args: any[]) => unknown;
95
90
  }
@@ -251,10 +246,10 @@ type LoadOptions = {
251
246
  setCookieDomain?: string;
252
247
  sameSiteCookie?: CookieSameSite;
253
248
  lockIntegrationsVersion?: boolean;
249
+ lockPluginsVersion?: boolean;
254
250
  polyfillIfRequired?: boolean;
255
251
  onLoaded?: OnLoadedCallback;
256
252
  uaChTrackLevel?: UaChTrackLevel;
257
- residencyServer?: ResidencyServerRegion;
258
253
  getSourceConfig?: () => string | ApiObject | Promise<ApiObject> | Promise<string>;
259
254
  sendAdblockPage?: boolean;
260
255
  sendAdblockPageOptions?: ApiOptions;
@@ -580,6 +575,7 @@ interface IXHRRequestOptions {
580
575
  headers: Record<string, string | undefined>;
581
576
  data?: XMLHttpRequestBodyInit;
582
577
  sendRawData?: boolean;
578
+ withCredentials?: boolean;
583
579
  }
584
580
  type HTTPClientMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
585
581
  interface IHttpClient {
@@ -792,7 +788,7 @@ interface IEventManager {
792
788
  interface ICapabilitiesManager {
793
789
  logger?: ILogger;
794
790
  errorHandler?: IErrorHandler;
795
- externalSrcLoader?: IExternalSrcLoader;
791
+ externalSrcLoader: IExternalSrcLoader;
796
792
  init(): void;
797
793
  detectBrowserCapabilities(): void;
798
794
  prepareBrowserCapabilities(): void;
@@ -1025,4 +1021,4 @@ declare global {
1025
1021
  }
1026
1022
  //# sourceMappingURL=index.d.ts.map
1027
1023
 
1028
- export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type ConsentOptions, type CookieSameSite, type DestinationsQueueOpts, type IdentifyTraits, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, type ResidencyServerRegion, RudderAnalytics, type RudderAnalyticsPreloader, type SessionOpts, type UaChTrackLevel };
1024
+ export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type ConsentOptions, type CookieSameSite, type DestinationsQueueOpts, type IdentifyTraits, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, RudderAnalytics, type RudderAnalyticsPreloader, type SessionOpts, type UaChTrackLevel };