@splitsoftware/browser-rum-agent
Advanced tools
Comparing version 0.4.2-rc.1 to 0.4.2-rc.2
@@ -1,4 +0,4 @@ | ||
0.5.0 (February XX, 2024) | ||
- Added a new event collector named `amplitudeCollector`. This collector integrates with the Amplitude SDK client to automatically capture Amplitude events and forward them to Split. Read more in our docs. | ||
- Updated TypeScript declarations for a better IntelliSense support. | ||
0.4.2 (March 1, 2024) | ||
- Adding a default prefix for events to simplify compatibility with Split's out-of-the-box metrics feature. This value can be changed or override with empty via the config `prefix` option. | ||
- Updated TypeScript declaration file to use TSDoc comments and improve type definitions. | ||
@@ -5,0 +5,0 @@ 0.4.1 (February 2, 2024) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.webVitals = exports.tti = exports.routeChanges = exports.amplitudeCollector = exports.SplitRumAgent = void 0; | ||
exports.webVitals = exports.routeChanges = exports.tti = exports.SplitRumAgent = void 0; | ||
// Create SplitRumAgent namespace and export it for ESM/CJS imports | ||
@@ -9,9 +9,7 @@ // Must use a named import to create the SplitRumAgent namespace (side effects) | ||
// Pluggable event collectors | ||
var amplitude_1 = require("./metrics/amplitude"); | ||
Object.defineProperty(exports, "amplitudeCollector", { enumerable: true, get: function () { return amplitude_1.amplitudeCollector; } }); | ||
var tti_1 = require("./metrics/tti"); | ||
Object.defineProperty(exports, "tti", { enumerable: true, get: function () { return tti_1.tti; } }); | ||
var routeChanges_1 = require("./metrics/routeChanges"); | ||
Object.defineProperty(exports, "routeChanges", { enumerable: true, get: function () { return routeChanges_1.routeChanges; } }); | ||
var tti_1 = require("./metrics/tti"); | ||
Object.defineProperty(exports, "tti", { enumerable: true, get: function () { return tti_1.tti; } }); | ||
var webVitals_1 = require("./metrics/webVitals"); | ||
Object.defineProperty(exports, "webVitals", { enumerable: true, get: function () { return webVitals_1.webVitals; } }); |
@@ -32,4 +32,2 @@ "use strict"; | ||
* Captures uncaught errors and promise rejections. | ||
* | ||
* \@TODO: sync snippet in HTML head to not miss events if loaded asynchronously. | ||
*/ | ||
@@ -36,0 +34,0 @@ function onError(ctx) { |
@@ -33,3 +33,3 @@ "use strict"; | ||
p: {}, | ||
prefix: '', | ||
prefix: 'split.rum', | ||
url: 'https://events.split.io/api', | ||
@@ -36,0 +36,0 @@ pushRate: 30, |
@@ -38,2 +38,2 @@ "use strict"; | ||
exports.userAgent = getUserAgent(); | ||
exports.languageVersion = 'jsrum-' + '0.4.2-rc.1'; | ||
exports.languageVersion = 'jsrum-' + '0.4.2-rc.2'; |
@@ -5,5 +5,4 @@ // Create SplitRumAgent namespace and export it for ESM/CJS imports | ||
// Pluggable event collectors | ||
export { amplitudeCollector } from './metrics/amplitude'; | ||
export { tti } from './metrics/tti'; | ||
export { routeChanges } from './metrics/routeChanges'; | ||
export { tti } from './metrics/tti'; | ||
export { webVitals } from './metrics/webVitals'; |
@@ -28,4 +28,2 @@ import { getErrorData } from '../utils/getErrorData'; | ||
* Captures uncaught errors and promise rejections. | ||
* | ||
* \@TODO: sync snippet in HTML head to not miss events if loaded asynchronously. | ||
*/ | ||
@@ -32,0 +30,0 @@ export function onError(ctx) { |
@@ -30,3 +30,3 @@ import { setSchedule, flush, track, queue } from './queue'; | ||
p: {}, | ||
prefix: '', | ||
prefix: 'split.rum', | ||
url: 'https://events.split.io/api', | ||
@@ -33,0 +33,0 @@ pushRate: 30, |
@@ -31,2 +31,2 @@ /* eslint-disable compat/compat */ | ||
export var userAgent = getUserAgent(); | ||
export var languageVersion = 'jsrum-' + '0.4.2-rc.1'; | ||
export var languageVersion = 'jsrum-' + '0.4.2-rc.2'; |
{ | ||
"name": "@splitsoftware/browser-rum-agent", | ||
"version": "0.4.2-rc.1", | ||
"version": "0.4.2-rc.2", | ||
"description": "Split Software RUM Agent for Browsers.", | ||
@@ -44,3 +44,2 @@ "main": "cjs/index.js", | ||
"devDependencies": { | ||
"@amplitude/analytics-types": "^2.4.0", | ||
"@rollup/plugin-commonjs": "^23.0.4", | ||
@@ -47,0 +46,0 @@ "@rollup/plugin-json": "^5.0.2", |
@@ -24,3 +24,3 @@ /* eslint-disable no-use-before-define */ | ||
/** | ||
* A function that receives the RUM Agent's object, used to send events to Split. | ||
* A function that receives the RUM Agent object, used to send events to Split. | ||
* | ||
@@ -74,4 +74,5 @@ * It can optionally return an object with a `flush` method, which will be called by the RUM Agent when to page is hidden or terminated (See {@link https://developer.chrome.com/articles/page-lifecycle-api/#states}). | ||
* For example, if you set the prefix to 'my-app', the event type 'error' will be sent as 'my-app.error'. | ||
* If you set the prefix to an empty string, the event type 'error' will be sent as 'error'. | ||
* | ||
* @defaultValue `''` | ||
* @defaultValue `'split.rum'` | ||
*/ | ||
@@ -167,5 +168,4 @@ prefix?: string, | ||
* It is exposed for internal usage only, not considered part of the public API, and might be renamed or removed eventually. | ||
* | ||
* \@TODO remove from type definitions or replace with a `settings` property. | ||
*/ | ||
// @TODO remove from type definitions or replace with a `settings` property. | ||
__getConfig(): SplitRumAgentSettings; | ||
@@ -379,33 +379,1 @@ /** | ||
export declare function webVitals(options?: IWebVitalsOptions): EventCollector; | ||
export type AmplitudeCollectorOptions = { | ||
/** | ||
* Whether to use the Amplitude Browser SDK identity to set an identity for the RUM Agent. | ||
* If `false`, the IDENTIFY event will be ignored. You can still use the `addIdentity` method to set an identity for the RUM Agent. | ||
* If `true`, the collector will use the `user_id` from the Amplitude IDENTIFY event to add an identity with traffic type `'user'` to the RUM Agent. | ||
* If `user_id` is not present, the collector will use the `device_id` to add an identity with traffic type `'anonymous'`. | ||
* | ||
* @defaultValue `false` | ||
*/ | ||
useAmplitudeIdentity?: boolean; | ||
} | ||
/** | ||
* Collects events from the Amplitude Browser SDK client, by creating an Amplitude destination plugin ({@link https://www.docs.developers.amplitude.com/data/sdk-plugins/#destination-type-plugin}). | ||
* | ||
* Setup example: | ||
* ``` | ||
* import * as amplitude from '@amplitude/analytics-browser'; | ||
* import { SplitRumAgent, amplitudeCollector } from '@splitsoftware/browser-rum-agent'; | ||
* | ||
* SplitRumAgent.register(amplitudeCollector(amplitude.add, { useAmplitudeIdentity: true })); | ||
* ``` | ||
* | ||
* @param amplitudeAdd - The `add` method from the Amplitude client | ||
* @param options - Collector options | ||
* @defaultValue | ||
* ``` | ||
* { useAmplitudeIdentity: false } | ||
* ``` | ||
*/ | ||
export declare function amplitudeCollector(amplitudeAdd: (plugin: unknown) => unknown, options?: AmplitudeCollectorOptions): EventCollector; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26
127347
71
2680