From 9c8351051b90efc00f73e0311d8e08c57ee3243d Mon Sep 17 00:00:00 2001 From: Louis Pinsard Date: Mon, 13 Nov 2023 17:01:25 +0100 Subject: [PATCH 1/2] chore: add internalId in signature --- packages/dialog-browser/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/dialog-browser/src/index.ts b/packages/dialog-browser/src/index.ts index 200a7e2..09cfb57 100644 --- a/packages/dialog-browser/src/index.ts +++ b/packages/dialog-browser/src/index.ts @@ -32,6 +32,7 @@ export class Analytics { telegramUsername?: string; twitterProfileUrl?: string; phone?: string; + internalId?: string; createdAt?: string; } & { [key: string]: string | number }; }): void { From 73ce548a8491e17bf7762c5e4a65c1fda3b53a9b Mon Sep 17 00:00:00 2001 From: Louis Pinsard Date: Mon, 13 Nov 2023 17:02:33 +0100 Subject: [PATCH 2/2] fix: avoid being blocked by Brave because of sendBeacon --- packages/dialog-browser/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dialog-browser/src/index.ts b/packages/dialog-browser/src/index.ts index 09cfb57..84307ef 100644 --- a/packages/dialog-browser/src/index.ts +++ b/packages/dialog-browser/src/index.ts @@ -41,14 +41,14 @@ export class Analytics { } const apiUrl = `${PROD_BASE_API_URL}${IDENTIFY_PATH}?apiKey=${this.apiKey}`; - window.navigator.sendBeacon( - apiUrl, - JSON.stringify({ + void fetch(apiUrl, { + method: 'POST', + body: JSON.stringify({ walletAddress, location: window.location.toString(), chainId, traits, }), - ); + }); } }