From 65b177f146247396a5971ca64c7f1c324bcac983 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Thu, 22 Aug 2024 16:21:59 +0530 Subject: [PATCH] fix: userId in braze hyrbrid --- .../src/integrations/Braze/browser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/analytics-js-integrations/src/integrations/Braze/browser.js b/packages/analytics-js-integrations/src/integrations/Braze/browser.js index 27f4632e02..9fa8e9ad4b 100644 --- a/packages/analytics-js-integrations/src/integrations/Braze/browser.js +++ b/packages/analytics-js-integrations/src/integrations/Braze/browser.js @@ -110,12 +110,14 @@ class Braze { */ // eslint-disable-next-line sonarjs/cognitive-complexity identify(rudderElement) { + const { message } = rudderElement; + const { userId } = message; + if (this.isHybridModeEnabled) { + window.braze.changeUser(userId); return; } - const { message } = rudderElement; - const { userId } = message; const { context } = message; const email = context?.traits?.email; const firstName = context?.traits?.firstName || context?.traits?.firstname;