Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setup = (config) => {
appInsights.setup(config.credentials.key)
.setAutoDependencyCorrelation(config.autoDependencyCorrelation || false)
.setAutoCollectRequests(config.autoCollectRequests || false)
.setAutoCollectPerformance(config.autoCollectPerformance || false)
.setAutoCollectExceptions(config.autoCollectExceptions || false)
.setAutoCollectDependencies(config.autoCollectDependencies || false)
.setAutoCollectConsole(config.autoCollectConsole || false, true)
.setUseDiskRetryCaching(config.useDiskRetryCaching || false)
.setSendLiveMetrics(config.sendLiveMetrics || false)
.setDistributedTracingMode(config.distributedTracingTracingMode || appInsights.DistributedTracingModes.AI)
.start();
client = appInsights.defaultClient;
};