@dynatrace/react-native-plugin
Version:
This plugin gives you the ability to use the Dynatrace Mobile agent in your react native application.
32 lines (31 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseDataEventModifier = void 0;
const ConfigurationHandler_1 = require("../../../core/configuration/ConfigurationHandler");
const ConsoleLogger_1 = require("../../../core/logging/ConsoleLogger");
class BaseDataEventModifier {
constructor(viewInfo) {
this.viewInfo = viewInfo;
this.logger = new ConsoleLogger_1.ConsoleLogger('BaseDataEventModifier');
}
modifyEvent(event) {
if (event == null) {
this.logger.debug(`modifyEvent(${JSON.stringify(event)}): Event is null!`);
return event;
}
Object.assign(event, this.viewInfo);
event["dt.rum.event.source.type"] = 'react_native';
const bundleName = ConfigurationHandler_1.ConfigurationHandler.getBundleName();
if (bundleName !== undefined) {
event["react_native.bundle.name"] =
bundleName;
}
const bundleVersion = ConfigurationHandler_1.ConfigurationHandler.getBundleVersion();
if (bundleVersion !== undefined) {
event["react_native.bundle.version"] =
bundleVersion;
}
return event;
}
}
exports.BaseDataEventModifier = BaseDataEventModifier;