@exodus/analytics
Advanced tools
Comparing version 2.1.0 to 3.0.0
import ExodusModule from '@exodus/module' | ||
import { fetchival } from '@exodus/fetch' | ||
import validateEvent from './schemas/main.schemasafe.json' | ||
@@ -18,2 +19,3 @@ // { experimentName: variant } -> ['experimentName:variant'] | ||
#installEventReportingUrl = null | ||
#trackUnvalidated = false | ||
@@ -42,2 +44,3 @@ #checkRequiredOptions = (options) => { | ||
config: { installEventReportingUrl } = {}, | ||
trackUnvalidated, | ||
} = options | ||
@@ -49,2 +52,3 @@ | ||
this.#installEventReportingUrl = installEventReportingUrl // optional | ||
this.#trackUnvalidated = trackUnvalidated | ||
} | ||
@@ -111,2 +115,9 @@ | ||
try { | ||
validateEvent(args) | ||
} catch (err) { | ||
this._logger.warn(err.message, `for event '${args.name}'`) | ||
if (this.#trackUnvalidated !== true) return | ||
} | ||
try { | ||
if (this.#connected && (await this.#canTrack(force))) { | ||
@@ -113,0 +124,0 @@ await this.#tracker.track(args) |
{ | ||
"name": "@exodus/analytics", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "This library abstracts analytics reporting.", | ||
@@ -8,2 +8,3 @@ "files": [ | ||
"atoms", | ||
"schemasafe.config.js", | ||
"!**/__tests__" | ||
@@ -32,2 +33,4 @@ ], | ||
"devDependencies": { | ||
"@exodus/schemasafe": "^1.0.0", | ||
"@exodus/schemasafe-babel-plugin": "^0.0.1", | ||
"eslint": "^8.33.0" | ||
@@ -38,3 +41,3 @@ }, | ||
}, | ||
"gitHead": "ba219ca9ea31decf1de775be9a59a56bb8bb2128" | ||
"gitHead": "17e471e85bde8c5e4abdc0dabdd49a8be850de76" | ||
} |
@@ -36,2 +36,3 @@ # Exodus analytics | ||
| shareActivityAtom | yes | An [atom](https://github.com/ExodusMovement/exodus-hydra/tree/master/modules/atoms/src) returning a boolean value indicating if a consumer application is ready to send events. | | ||
| trackUnvalidated | no | A boolean flag indicating if not validated events should be still submitted to Segment API. `false` by default | | ||
| config | no | Static configuration options | | ||
@@ -38,0 +39,0 @@ | config.installEventReportingUrl | no | Url to which to post app install events | |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10300
8
197
48
3
1