@formo/analytics 1.16.0 → 1.16.1
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/cjs/src/FormoAnalytics.d.ts +3 -3
- package/dist/cjs/src/FormoAnalytics.d.ts.map +1 -1
- package/dist/cjs/src/FormoAnalytics.js +7 -10
- package/dist/cjs/src/FormoAnalytics.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/FormoAnalytics.d.ts +3 -3
- package/dist/esm/src/FormoAnalytics.d.ts.map +1 -1
- package/dist/esm/src/FormoAnalytics.js +7 -10
- package/dist/esm/src/FormoAnalytics.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/FormoAnalytics.ts +7 -11
package/package.json
CHANGED
package/src/FormoAnalytics.ts
CHANGED
|
@@ -127,7 +127,7 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
127
127
|
|
|
128
128
|
// Detect
|
|
129
129
|
const providers = await analytics.getProviders();
|
|
130
|
-
await analytics.
|
|
130
|
+
await analytics.detects(providers);
|
|
131
131
|
|
|
132
132
|
return analytics;
|
|
133
133
|
}
|
|
@@ -309,7 +309,7 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
|
-
* Emits an
|
|
312
|
+
* Emits an detect event with current wallet provider info.
|
|
313
313
|
* @param {Address} params.address
|
|
314
314
|
* @returns {Promise<void>}
|
|
315
315
|
*/
|
|
@@ -337,7 +337,7 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
337
337
|
* @param {Address} params.address
|
|
338
338
|
* @returns {Promise<void>}
|
|
339
339
|
*/
|
|
340
|
-
private async
|
|
340
|
+
private async detect({
|
|
341
341
|
providerName,
|
|
342
342
|
rdns,
|
|
343
343
|
}: {
|
|
@@ -346,7 +346,7 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
346
346
|
}): Promise<void> {
|
|
347
347
|
if (this.session.isWalletDetected(rdns))
|
|
348
348
|
return logger.warn(
|
|
349
|
-
`
|
|
349
|
+
`detect: Wallet ${providerName} already detected in this session`
|
|
350
350
|
);
|
|
351
351
|
|
|
352
352
|
this.session.markWalletdetected(rdns);
|
|
@@ -668,14 +668,10 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
668
668
|
const address = await this.getAddress();
|
|
669
669
|
const user_id = this.userId;
|
|
670
670
|
|
|
671
|
-
if (payload?.userId) {
|
|
672
|
-
delete payload.userId;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
671
|
const requestData: RequestEvent = {
|
|
676
672
|
anonymous_id: this.anonymousId as UUID,
|
|
677
673
|
user_id,
|
|
678
|
-
address
|
|
674
|
+
address,
|
|
679
675
|
timestamp: new Date().toISOString(),
|
|
680
676
|
action,
|
|
681
677
|
version: "1",
|
|
@@ -709,12 +705,12 @@ export class FormoAnalytics implements IFormoAnalytics {
|
|
|
709
705
|
return providers;
|
|
710
706
|
}
|
|
711
707
|
|
|
712
|
-
private async
|
|
708
|
+
private async detects(
|
|
713
709
|
providers: readonly EIP6963ProviderDetail[]
|
|
714
710
|
): Promise<void> {
|
|
715
711
|
try {
|
|
716
712
|
for (const eip6963ProviderDetail of providers) {
|
|
717
|
-
await this.
|
|
713
|
+
await this.detect({
|
|
718
714
|
providerName: eip6963ProviderDetail?.info.name,
|
|
719
715
|
rdns: eip6963ProviderDetail?.info.rdns,
|
|
720
716
|
});
|