@datadog/mobile-react-native
Version:
A client-side React Native module to interact with Datadog
39 lines (36 loc) • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debugId = void 0;
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/
// eslint-disable-next-line import/no-mutable-exports
let debugId = exports.debugId = null;
/**
* Loads the Datadog Debug ID dynamically
*/
function loadDebugId() {
if (typeof globalThis === 'undefined') {
return;
}
try {
const debugIds = globalThis._datadogDebugIds;
if (!debugIds || Object.keys(debugIds).length === 0) {
if (process.env.NODE_ENV !== 'test') {
console.warn('[Datadog SDK] Debug ID not found. Are you using @datadog/mobile-react-native/metro config?');
}
return;
}
exports.debugId = debugId = debugIds[Object.keys(debugIds)[0]];
} catch (error) {
if (process.env.NODE_ENV !== 'test') {
console.warn('[Datadog SDK] Error while retrieving Debug ID. Are you using @datadog/mobile-react-native/metro config?');
}
}
}
loadDebugId();
//# sourceMappingURL=debugIdResolver.js.map