@armco/analytics 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { init, identify, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession } from "./analytics";
2
- export { init, identify, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, };
1
+ import { init, identify, getEnvironment, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession } from "./analytics";
2
+ export { init, identify, getEnvironment, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, };
package/dist/index.js CHANGED
@@ -1,5 +1,13 @@
1
- import { init, identify, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, } from "./analytics";
1
+ import { init, identify, getEnvironment, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, } from "./analytics";
2
2
  document.addEventListener("DOMContentLoaded", function (event) {
3
- init();
3
+ const environment = getEnvironment();
4
+ console.info("[ANALYTICS] Idenfitied environment: ", environment);
5
+ if (!environment || environment === "development") {
6
+ console.info("[ANALYTICS] Attempting to auto-load analytics configurations from environment...");
7
+ init();
8
+ }
9
+ else {
10
+ console.info("[ANALYTICS] Identified non-dev environment, analytics auto load wouldn't be attempted.");
11
+ }
4
12
  });
5
- export { init, identify, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, };
13
+ export { init, identify, getEnvironment, getEnvironmentType, trackEvent, trackPageView, trackError, enableTracking, generateAnonymousId, sendHostProjectName, getSessionId, startSession, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armco/analytics",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Browser Based Analytics interceptor for configured events",
5
5
  "main": "index.js",
6
6
  "type": "module",