hud-sdk
Version:
Hud's Node SDK
2 lines • 1.68 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(global,()=>(()=>{"use strict";var e={523:e=>{e.exports=require("./logger")},2546:e=>{e.exports=require("./lib")},5809:e=>{e.exports=require("./config")},7131:e=>{e.exports=require("./wrap")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.setContext=function(e){try{const r=(0,a.getInvestigationStorage)();if(void 0===r)return void(c||(i.app_logger.warning("HudContext warning: No Storage"),i.customer_logger.logEntry(n.UserErrorLogs.SetContextBeforeRegister()),c=!0));if(!t.hudConfig.dynamicConfig.enableInvestigation)return;const o=r.getStore();if(void 0===o)return void(s||(i.app_logger.warning("HudContext warning: setContext called not inside async context. Skipping."),i.customer_logger.logEntry(n.UserErrorLogs.SetContextNoAsyncContext()),s=!0));const g=(0,n.validateContext)(e);o.userContext={...o.userContext,...g}}catch(e){if(e instanceof n.HudContextValidationError)return void(p||(i.app_logger.warning("HudContext warning: failed to validate context. Skipping.",{error:e,stack:e instanceof Error&&null!==e?e.stack:void 0}),p=!0));g||(i.app_logger.warning("HudContext warning: failed to set context. Skipping.",{error:e,stack:e instanceof Error&&null!==e?e.stack:void 0}),g=!0)}};const t=r(5809),n=r(2546),i=r(523),a=r(7131);let s=!1,g=!1,c=!1,p=!1})(),o})());
//# sourceMappingURL=api.js.map