@basis-theory/basis-theory-js
Advanced tools
Comparing version 4.23.0 to 4.23.1
@@ -31,3 +31,3 @@ "use strict"; | ||
exports.DD_TOKEN = DD_TOKEN; | ||
const DD_GIT_SHA = "f6e1c47d5deee3b136e999171243c4cad67757a2"; | ||
const DD_GIT_SHA = "c87a19b595c31ac80783989cd97d882a8cbd74d8"; | ||
exports.DD_GIT_SHA = DD_GIT_SHA; | ||
@@ -34,0 +34,0 @@ const CLIENT_BASE_PATHS = { |
@@ -15,4 +15,2 @@ "use strict"; | ||
const log = async (message, level, attributes = {}) => { | ||
var _document; | ||
if (!isTelemetryEnabled) { | ||
@@ -22,29 +20,30 @@ return; | ||
let env; | ||
try { | ||
var _document, _window, _window$location, _window2, _window2$location, _navigator; | ||
if (_constants.DEFAULT_BASE_URL.includes('localhost')) { | ||
env = 'local'; | ||
} else if (_constants.DEFAULT_BASE_URL.includes('dev')) { | ||
env = 'dev'; | ||
} else { | ||
env = 'prod'; | ||
} | ||
let env; | ||
const payload = { | ||
// dd info | ||
level, | ||
message, | ||
// for basis theory tracking | ||
service: 'js-sdk', | ||
env, | ||
// browser information | ||
referrer: (_document = document) === null || _document === void 0 ? void 0 : _document.referrer, | ||
origin: window.location.origin, | ||
url: window.location.href, | ||
userAgent: navigator.userAgent, | ||
// custom values | ||
...attributes | ||
}; | ||
if (_constants.DEFAULT_BASE_URL.includes('localhost')) { | ||
env = 'local'; | ||
} else if (_constants.DEFAULT_BASE_URL.includes('dev')) { | ||
env = 'dev'; | ||
} else { | ||
env = 'prod'; | ||
} | ||
try { | ||
const payload = { | ||
// dd info | ||
level, | ||
message, | ||
// for basis theory tracking | ||
service: 'js-sdk', | ||
env, | ||
// browser information | ||
referrer: (_document = document) === null || _document === void 0 ? void 0 : _document.referrer, | ||
origin: (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin, | ||
url: (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$location = _window2.location) === null || _window2$location === void 0 ? void 0 : _window2$location.href, | ||
userAgent: (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.userAgent, | ||
// custom values | ||
...attributes | ||
}; | ||
await fetch(`https://http-intake.logs.datadoghq.com/v1/input/${ddTok}`, { | ||
@@ -51,0 +50,0 @@ method: 'POST', |
{ | ||
"name": "@basis-theory/basis-theory-js", | ||
"version": "4.23.0", | ||
"version": "4.23.1", | ||
"repository": "https://github.com/Basis-Theory/basis-theory-js", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
197358