From 4bf4f48ae1a312b20aa9493d6c455d157c79b823 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Fri, 10 Nov 2023 22:23:27 +0530 Subject: [PATCH] feat(INT-503): hybrid mode braze (#1030) --- .../destinations/braze/db-config.json | 16 +++++++++++++--- .../destinations/braze/schema.json | 5 +++-- .../destinations/braze/ui-config.json | 14 ++++++++++++++ test/data/validation/destinations/braze.json | 3 +-- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/configurations/destinations/braze/db-config.json b/src/configurations/destinations/braze/db-config.json index 4037af6dd..60732c6cb 100644 --- a/src/configurations/destinations/braze/db-config.json +++ b/src/configurations/destinations/braze/db-config.json @@ -19,7 +19,8 @@ "whitelistedEvents", "oneTrustCookieCategories", "eventFilteringOption", - "connectionMode" + "connectionMode", + "enablePushNotification" ], "excludeKeys": [], "supportedSourceTypes": [ @@ -37,11 +38,20 @@ ], "supportedConnectionModes": { "android": ["cloud", "device", "hybrid"], - "web": ["cloud", "device"], + "web": ["cloud", "device", "hybrid"], "ios": ["cloud", "device", "hybrid"], "flutter": ["cloud", "device"], "reactnative": ["cloud", "device"] }, + "hybridModeCloudEventsFilter": { + "web": { + "messageType": [ + "identify", + "track", + "page" + ] + } + }, "supportedMessageTypes": ["group", "identify", "page", "screen", "track", "alias"], "destConfig": { "defaultConfig": [ @@ -61,7 +71,7 @@ "ios": ["useNativeSDK", "connectionMode"], "reactnative": ["useNativeSDK", "connectionMode"], "flutter": ["useNativeSDK", "connectionMode"], - "web": ["useNativeSDK", "enableBrazeLogging", "connectionMode"] + "web": ["useNativeSDK", "enableBrazeLogging", "connectionMode", "enablePushNotification"] }, "secretKeys": ["restApiKey"] } diff --git a/src/configurations/destinations/braze/schema.json b/src/configurations/destinations/braze/schema.json index 5b691ee1e..77cad0f87 100644 --- a/src/configurations/destinations/braze/schema.json +++ b/src/configurations/destinations/braze/schema.json @@ -90,11 +90,12 @@ "properties": { "android": { "type": "string", "enum": ["cloud", "device", "hybrid"] }, "ios": { "type": "string", "enum": ["cloud", "device", "hybrid"] }, - "web": { "type": "string", "enum": ["cloud", "device"] }, + "web": { "type": "string", "enum": ["cloud", "device", "hybrid"] }, "reactnative": { "type": "string", "enum": ["cloud", "device"] }, "flutter": { "type": "string", "enum": ["cloud", "device"] } } - } + }, + "enablePushNotification": { "type": "object", "properties": { "web": { "type": "boolean" } } } } } } diff --git a/src/configurations/destinations/braze/ui-config.json b/src/configurations/destinations/braze/ui-config.json index e08209153..96c4780f3 100644 --- a/src/configurations/destinations/braze/ui-config.json +++ b/src/configurations/destinations/braze/ui-config.json @@ -380,6 +380,20 @@ "configKey": "enableBrazeLogging", "default": false, "note": "Turn on if you want to show braze logs to customer" + }, + { + "type": "checkbox", + "label": "Use web push notifications", + "configKey": "enablePushNotification", + "default": false, + "note": [ + "Turn on if you want to use ", + { + "text": "push notification", + "link": "https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration/#step-1-configure-your-sites-service-worker" + }, + ". It requires service worker setup by client." + ] } ] } diff --git a/test/data/validation/destinations/braze.json b/test/data/validation/destinations/braze.json index 2339b91ca..46ff68054 100644 --- a/test/data/validation/destinations/braze.json +++ b/test/data/validation/destinations/braze.json @@ -166,7 +166,6 @@ "web": "hybrid" } }, - "result": false, - "err": ["connectionMode.web must be equal to one of the allowed values"] + "result": true } ]