@rudderstack/analytics-js 3.3.0 → 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 +19 -0
- package/README.md +9 -15
- package/dist/npm/index.d.ts +2 -7
- package/dist/npm/legacy/cjs/index.js +65 -77
- package/dist/npm/legacy/esm/index.js +65 -77
- package/dist/npm/legacy/umd/index.js +65 -77
- package/dist/npm/modern/bundled/cjs/index.js +50 -62
- package/dist/npm/modern/bundled/esm/index.js +50 -62
- package/dist/npm/modern/bundled/umd/index.js +50 -62
- package/dist/npm/modern/cjs/index.js +30 -53
- package/dist/npm/modern/content-script/cjs/index.js +47 -62
- package/dist/npm/modern/content-script/esm/index.js +47 -62
- package/dist/npm/modern/content-script/umd/index.js +47 -62
- package/dist/npm/modern/esm/index.js +30 -53
- package/dist/npm/modern/umd/index.js +30 -53
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,25 @@
|
|
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
|
+
|
5
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)
|
6
25
|
|
7
26
|
### Dependency Updates
|
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
|
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
|
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
|
83
|
-
- `npm run build:npm`: This outputs **dist/npm** folder that contains the
|
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
|
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
|
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)
|
package/dist/npm/index.d.ts
CHANGED
@@ -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;
|
@@ -1026,4 +1021,4 @@ declare global {
|
|
1026
1021
|
}
|
1027
1022
|
//# sourceMappingURL=index.d.ts.map
|
1028
1023
|
|
1029
|
-
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,
|
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 };
|