Socket
Socket
Sign inDemoInstall

@datadog/browser-rum-core

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum-core - npm Package Compare versions

Comparing version 5.16.0 to 5.17.1

15

cjs/boot/rumPublicApi.d.ts

@@ -62,6 +62,6 @@ import type { Context, User, DeflateWorker, DeflateEncoderStreamId, DeflateEncoder, TrackingConsent } from '@datadog/browser-core';

* Add a custom timing relative to the start of the current view,
* stored in @view.custom_timings.<timing_name>
* stored in `@view.custom_timings.<timing_name>`
*
* @param name name of the custom timing
* @param [time] epoch timestamp of the custom timing (if not set, will use current time)
* @param name Name of the custom timing
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
*

@@ -84,3 +84,10 @@ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.

/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
* Add a feature flag evaluation,
* stored in `@feature_flags.<feature_flag_key>`
*
* @param {string} key The key of the feature flag.
* @param {any} value The value of the feature flag.
*
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
* For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/

@@ -87,0 +94,0 @@ addFeatureFlagEvaluation: (key: string, value: any) => void;

@@ -105,6 +105,6 @@ "use strict";

* Add a custom timing relative to the start of the current view,
* stored in @view.custom_timings.<timing_name>
* stored in `@view.custom_timings.<timing_name>`
*
* @param name name of the custom timing
* @param [time] epoch timestamp of the custom timing (if not set, will use current time)
* @param name Name of the custom timing
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
*

@@ -138,3 +138,10 @@ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.

/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
* Add a feature flag evaluation,
* stored in `@feature_flags.<feature_flag_key>`
*
* @param {string} key The key of the feature flag.
* @param {any} value The value of the feature flag.
*
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
* For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/

@@ -141,0 +148,0 @@ addFeatureFlagEvaluation: (0, browser_core_1.monitor)(function (key, value) {

@@ -59,3 +59,3 @@ "use strict";

},
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.16.0" : undefined,
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.17.1" : undefined,
},

@@ -62,0 +62,0 @@ application: {

@@ -16,9 +16,2 @@ "use strict";

function startFeatureFlagContexts(lifeCycle, customerDataTracker) {
if (!(0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.FEATURE_FLAGS)) {
return {
findFeatureFlagEvaluations: function () { return undefined; },
addFeatureFlagEvaluation: browser_core_1.noop,
stop: browser_core_1.noop,
};
}
var featureFlagContexts = new browser_core_1.ValueHistory(exports.FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY);

@@ -25,0 +18,0 @@ lifeCycle.subscribe(2 /* LifeCycleEventType.BEFORE_VIEW_CREATED */, function (_a) {

@@ -26,3 +26,3 @@ "use strict";

if (isValid(vital)) {
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital));
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital, true));
}

@@ -42,17 +42,25 @@ },

}
function processVital(vital) {
function processVital(vital, valueComputedBySdk) {
var _a;
return {
rawRumEvent: {
date: vital.startClocks.timeStamp,
var rawRumEvent = {
date: vital.startClocks.timeStamp,
vital: {
id: (0, browser_core_1.generateUUID)(),
type: vital.type,
name: vital.name,
custom: (_a = {},
_a[vital.name] = vital.value,
_a),
},
type: "vital" /* RumEventType.VITAL */,
};
if (valueComputedBySdk) {
rawRumEvent._dd = {
vital: {
id: (0, browser_core_1.generateUUID)(),
type: vital.type,
name: vital.name,
custom: (_a = {},
_a[vital.name] = vital.value,
_a),
computed_value: true,
},
type: "vital" /* RumEventType.VITAL */,
},
};
}
return {
rawRumEvent: rawRumEvent,
startTime: vital.startClocks.relative,

@@ -59,0 +67,0 @@ customerContext: vital.context,

@@ -210,2 +210,7 @@ import type { Context, Duration, ErrorSource, ErrorHandling, ResourceType, ServerDuration, TimeStamp, RawErrorCause, DefaultPrivacyLevel, Connectivity, Csp } from '@datadog/browser-core';

};
_dd?: {
vital: {
computed_value: true;
};
};
}

@@ -212,0 +217,0 @@ export declare const enum VitalType {

@@ -1006,2 +1006,18 @@ /**

};
/**
* Internal properties
*/
readonly _dd?: {
/**
* Internal vital properties
*/
readonly vital?: {
/**
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
*/
readonly computed_value?: boolean;
[k: string]: unknown;
};
[k: string]: unknown;
};
[k: string]: unknown;

@@ -1008,0 +1024,0 @@ };

@@ -62,6 +62,6 @@ import type { Context, User, DeflateWorker, DeflateEncoderStreamId, DeflateEncoder, TrackingConsent } from '@datadog/browser-core';

* Add a custom timing relative to the start of the current view,
* stored in @view.custom_timings.<timing_name>
* stored in `@view.custom_timings.<timing_name>`
*
* @param name name of the custom timing
* @param [time] epoch timestamp of the custom timing (if not set, will use current time)
* @param name Name of the custom timing
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
*

@@ -84,3 +84,10 @@ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.

/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
* Add a feature flag evaluation,
* stored in `@feature_flags.<feature_flag_key>`
*
* @param {string} key The key of the feature flag.
* @param {any} value The value of the feature flag.
*
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
* For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/

@@ -87,0 +94,0 @@ addFeatureFlagEvaluation: (key: string, value: any) => void;

@@ -102,6 +102,6 @@ import { addTelemetryUsage, timeStampToClocks, isExperimentalFeatureEnabled, ExperimentalFeature, assign, createContextManager, deepClone, makePublicApi, monitor, clocksNow, callMonitored, createHandlingStack, checkUser, sanitizeUser, sanitize, createIdentityEncoder, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, createTrackingConsentState, } from '@datadog/browser-core';

* Add a custom timing relative to the start of the current view,
* stored in @view.custom_timings.<timing_name>
* stored in `@view.custom_timings.<timing_name>`
*
* @param name name of the custom timing
* @param [time] epoch timestamp of the custom timing (if not set, will use current time)
* @param name Name of the custom timing
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
*

@@ -135,3 +135,10 @@ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.

/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
* Add a feature flag evaluation,
* stored in `@feature_flags.<feature_flag_key>`
*
* @param {string} key The key of the feature flag.
* @param {any} value The value of the feature flag.
*
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
* For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/

@@ -138,0 +145,0 @@ addFeatureFlagEvaluation: monitor(function (key, value) {

@@ -56,3 +56,3 @@ import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, isExperimentalFeatureEnabled, ExperimentalFeature, getConnectivity, } from '@datadog/browser-core';

},
browser_sdk_version: canUseEventBridge() ? "5.16.0" : undefined,
browser_sdk_version: canUseEventBridge() ? "5.17.1" : undefined,
},

@@ -59,0 +59,0 @@ application: {

@@ -1,2 +0,2 @@

import { noop, isExperimentalFeatureEnabled, SESSION_TIME_OUT_DELAY, ValueHistory, ExperimentalFeature, } from '@datadog/browser-core';
import { SESSION_TIME_OUT_DELAY, ValueHistory } from '@datadog/browser-core';
export var FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;

@@ -13,9 +13,2 @@ export var BYTES_COMPUTATION_THROTTLING_DELAY = 200;

export function startFeatureFlagContexts(lifeCycle, customerDataTracker) {
if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_FLAGS)) {
return {
findFeatureFlagEvaluations: function () { return undefined; },
addFeatureFlagEvaluation: noop,
stop: noop,
};
}
var featureFlagContexts = new ValueHistory(FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY);

@@ -22,0 +15,0 @@ lifeCycle.subscribe(2 /* LifeCycleEventType.BEFORE_VIEW_CREATED */, function (_a) {

@@ -23,3 +23,3 @@ import { combine, elapsed, generateUUID } from '@datadog/browser-core';

if (isValid(vital)) {
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital));
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital, true));
}

@@ -38,17 +38,25 @@ },

}
function processVital(vital) {
function processVital(vital, valueComputedBySdk) {
var _a;
return {
rawRumEvent: {
date: vital.startClocks.timeStamp,
var rawRumEvent = {
date: vital.startClocks.timeStamp,
vital: {
id: generateUUID(),
type: vital.type,
name: vital.name,
custom: (_a = {},
_a[vital.name] = vital.value,
_a),
},
type: "vital" /* RumEventType.VITAL */,
};
if (valueComputedBySdk) {
rawRumEvent._dd = {
vital: {
id: generateUUID(),
type: vital.type,
name: vital.name,
custom: (_a = {},
_a[vital.name] = vital.value,
_a),
computed_value: true,
},
type: "vital" /* RumEventType.VITAL */,
},
};
}
return {
rawRumEvent: rawRumEvent,
startTime: vital.startClocks.relative,

@@ -55,0 +63,0 @@ customerContext: vital.context,

@@ -210,2 +210,7 @@ import type { Context, Duration, ErrorSource, ErrorHandling, ResourceType, ServerDuration, TimeStamp, RawErrorCause, DefaultPrivacyLevel, Connectivity, Csp } from '@datadog/browser-core';

};
_dd?: {
vital: {
computed_value: true;
};
};
}

@@ -212,0 +217,0 @@ export declare const enum VitalType {

@@ -1006,2 +1006,18 @@ /**

};
/**
* Internal properties
*/
readonly _dd?: {
/**
* Internal vital properties
*/
readonly vital?: {
/**
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
*/
readonly computed_value?: boolean;
[k: string]: unknown;
};
[k: string]: unknown;
};
[k: string]: unknown;

@@ -1008,0 +1024,0 @@ };

{
"name": "@datadog/browser-rum-core",
"version": "5.16.0",
"version": "5.17.1",
"license": "Apache-2.0",

@@ -15,3 +15,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "5.16.0"
"@datadog/browser-core": "5.17.1"
},

@@ -32,3 +32,3 @@ "devDependencies": {

},
"gitHead": "7fd800d615f6e6a689597d064e709ac7fc0914ec"
"gitHead": "78b120d4775a8601f021adbba6df66ccfb07d8d2"
}

@@ -192,3 +192,2 @@ import type {

})
const rumPublicApi = makePublicApi({

@@ -251,6 +250,6 @@ init: monitor((initConfiguration: RumInitConfiguration) => strategy.init(initConfiguration)),

* Add a custom timing relative to the start of the current view,
* stored in @view.custom_timings.<timing_name>
* stored in `@view.custom_timings.<timing_name>`
*
* @param name name of the custom timing
* @param [time] epoch timestamp of the custom timing (if not set, will use current time)
* @param name Name of the custom timing
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
*

@@ -291,3 +290,10 @@ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.

/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
* Add a feature flag evaluation,
* stored in `@feature_flags.<feature_flag_key>`
*
* @param {string} key The key of the feature flag.
* @param {any} value The value of the feature flag.
*
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
* For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/

@@ -294,0 +300,0 @@ addFeatureFlagEvaluation: monitor((key: string, value: any) => {

import type { RelativeTime, ContextValue, Context, CustomerDataTracker } from '@datadog/browser-core'
import {
noop,
isExperimentalFeatureEnabled,
SESSION_TIME_OUT_DELAY,
ValueHistory,
ExperimentalFeature,
} from '@datadog/browser-core'
import { SESSION_TIME_OUT_DELAY, ValueHistory } from '@datadog/browser-core'
import type { LifeCycle } from '../lifeCycle'

@@ -35,10 +29,2 @@ import { LifeCycleEventType } from '../lifeCycle'

): FeatureFlagContexts {
if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_FLAGS)) {
return {
findFeatureFlagEvaluations: () => undefined,
addFeatureFlagEvaluation: noop,
stop: noop,
}
}
const featureFlagContexts = new ValueHistory<FeatureFlagContext>(FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY)

@@ -45,0 +31,0 @@

@@ -54,3 +54,3 @@ import type { ClocksState, Duration, Context } from '@datadog/browser-core'

if (isValid(vital)) {
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processVital(vital))
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processVital(vital, true))
}

@@ -71,16 +71,26 @@ },

function processVital(vital: DurationVital): RawRumEventCollectedData<RawRumVitalEvent> {
return {
rawRumEvent: {
date: vital.startClocks.timeStamp,
function processVital(vital: DurationVital, valueComputedBySdk: boolean): RawRumEventCollectedData<RawRumVitalEvent> {
const rawRumEvent: RawRumVitalEvent = {
date: vital.startClocks.timeStamp,
vital: {
id: generateUUID(),
type: vital.type,
name: vital.name,
custom: {
[vital.name]: vital.value,
},
},
type: RumEventType.VITAL,
}
if (valueComputedBySdk) {
rawRumEvent._dd = {
vital: {
id: generateUUID(),
type: vital.type,
name: vital.name,
custom: {
[vital.name]: vital.value,
},
computed_value: true,
},
type: RumEventType.VITAL,
},
}
}
return {
rawRumEvent,
startTime: vital.startClocks.relative,

@@ -87,0 +97,0 @@ customerContext: vital.context,

@@ -236,2 +236,7 @@ import type {

}
_dd?: {
vital: {
computed_value: true
}
}
}

@@ -238,0 +243,0 @@

@@ -1079,2 +1079,18 @@ /* eslint-disable */

}
/**
* Internal properties
*/
readonly _dd?: {
/**
* Internal vital properties
*/
readonly vital?: {
/**
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
*/
readonly computed_value?: boolean
[k: string]: unknown
}
[k: string]: unknown
}
[k: string]: unknown

@@ -1081,0 +1097,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc