@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formo/analytics",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/getformo/sdk.git"
@@ -127,7 +127,7 @@ export class FormoAnalytics implements IFormoAnalytics {
127
127
 
128
128
  // Detect
129
129
  const providers = await analytics.getProviders();
130
- await analytics.detectWallets(providers);
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 identify event with current wallet address.
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 detectWallet({
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
- `detectWallet: Wallet ${providerName} already detected in this session`
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: address?.toLowerCase() || null,
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 detectWallets(
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.detectWallet({
713
+ await this.detect({
718
714
  providerName: eip6963ProviderDetail?.info.name,
719
715
  rdns: eip6963ProviderDetail?.info.rdns,
720
716
  });