feat(braze-web): Upgrade SDK to v6.5.0 with opt-in support#3770
feat(braze-web): Upgrade SDK to v6.5.0 with opt-in support#3770AnkitSegment wants to merge 7 commits into
Conversation
- Add versioning-info.ts with stable (6.1) and canary (6.5) versions - Add version 6.5 to SDK version choices in settings - Add tests for both stable default and explicit 6.5 selection - All tests passing (25 tests, 6 suites) This is a browser-mode destination where customers explicitly select SDK versions from a dropdown. Version 6.5 is now available as an option while maintaining 6.1 as the safe default for new installations. Breaking changes analysis: No breaking changes between 6.1 and 6.5 - Enhancements: platform detection, banner functionality, cookie expiry config - Bug fixes: banner impressions, in-app message user isolation - All changes are backward-compatible Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds opt-in support for Braze Web SDK v6.5 (while keeping v6.1 as the default) in the Braze browser-mode destination, so customers can select the newer SDK version from settings without changing existing installs.
Changes:
- Introduces
versioning-info.tsto centralize stable/canary SDK version constants. - Updates destination settings to keep default at 6.1 and adds 6.5 to the
sdkVersiondropdown choices. - Extends initialization tests to cover default version behavior, explicit canary selection, and settings choices.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/browser-destinations/destinations/braze/src/versioning-info.ts | Adds stable/canary SDK version constants. |
| packages/browser-destinations/destinations/braze/src/index.ts | Uses stable constant for default and adds 6.5 as a selectable SDK version. |
| packages/browser-destinations/destinations/braze/src/tests/initialization.test.ts | Adds tests asserting default version loading, canary loading, and presence of 6.5 in choices. |
| packages/browser-destinations/destinations/braze/breaking-changes-analysis.md | Adds analysis document for the 6.1 → 6.5.0 SDK change. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (31.86%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3770 +/- ##
===========================================
- Coverage 80.84% 31.86% -48.99%
===========================================
Files 1377 15 -1362
Lines 26417 747 -25670
Branches 5581 125 -5456
===========================================
- Hits 21357 238 -21119
+ Misses 4097 509 -3588
+ Partials 963 0 -963 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… constants in choices, fix doc contradictions - Remove re-export of version constants from index.ts (tests import directly from versioning-info.ts) - Use DESTINATION_API_VERSION/DESTINATION_CANARY_API_VERSION constants in choices array to prevent drift - Fix breaking-changes-analysis.md to align with opt-in strategy (keep default at 6.1, remove feature flag references) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Breaking Changes Analysis: Braze Web SDK v6.1 → v6.5.0SummaryThe upgrade from Braze Web SDK v6.1 to v6.5.0 introduces NO BREAKING CHANGES. All updates are backward-compatible enhancements focusing on platform detection improvements, banner functionality extensions, and initialization flexibility. Version-by-Version Changesv6.2.0Type: ENHANCEMENT
v6.3.0Type: ENHANCEMENT
Type: ENHANCEMENT
Type: ENHANCEMENT
Type: BUGFIX
v6.3.1Type: BUGFIX
v6.4.0Type: ENHANCEMENT
Type: BUGFIX
v6.5.0Type: ENHANCEMENT
Why: This is a new optional parameter that allows customization of cookie lifetime. Since it has a sensible default (400 days), existing integrations continue to work without modification. How to apply: No changes required for this upgrade. If customers need custom cookie expiry, they can add this setting in future releases. Type: ENHANCEMENT
Type: ENHANCEMENT
Critical Breaking ChangesNONE - This is a fully backward-compatible upgrade. Non-Breaking Changes
Deprecation WarningsNONE - No features have been deprecated in this version range. Testing RequirementsCore Functionality Tests
Edge Cases
Regression Tests
Integration Impact AssessmentCurrent Integration PointsOur Braze web destination uses the following SDK features:
Files Requiring Updates
Risk AssessmentOverall Risk Level: LOW Rationale
Mitigation Strategy
Recommendations
Additional Notes
Changelog Source
|
| /** DESTINATION_API_VERSION | ||
| * Braze Web SDK version (stable/default for new installations). | ||
| * This is the default version selected for new destination configurations. | ||
| * Changelog: https://github.com/braze-inc/braze-web-sdk/blob/master/CHANGELOG.md | ||
| */ | ||
| export const DESTINATION_API_VERSION = '6.1' | ||
|
|
||
| /** DESTINATION_CANARY_API_VERSION | ||
| * Braze Web SDK version (newly available option). | ||
| * Version 6.5 is available for customers to explicitly select in settings. | ||
| * This allows customers to opt-in to the latest version before it becomes the default. | ||
| */ | ||
| export const DESTINATION_CANARY_API_VERSION = '6.5' |
| /** DESTINATION_API_VERSION | ||
| * Braze Web SDK version (stable/default for new installations). | ||
| * This is the default version selected for new destination configurations. |
| expect(callArgs.devicePropertyAllowlist).toEqual(devicePropertyAllowlist) | ||
| }) | ||
|
|
||
| test('uses stable SDK version by default (6.1)', async () => { |
| test('verifies SDK version 6.5 is available in settings choices', () => { | ||
| const sdkVersionField = destination.settings.sdkVersion | ||
| const choices = sdkVersionField?.choices || [] | ||
| const hasVersion65 = choices.some((choice) => choice.value === '6.5') | ||
|
|
arnav777dev
left a comment
There was a problem hiding this comment.
New findings from this review pass:
Missing test matrix coverage for v6.5 (medium)
trackEvent.test.ts:3 and trackPurchase.test.ts:4 both define testSdkVersions = ['3.5', '4.1'] and iterate tests across those versions. Version 6.5 is not included, so the new SDK version is never exercised through the action-level tests. Since the 6.x code path uses braze.no-module.min.js (vs appboy.no-amd.min.js for 3.x), adding '6.1' or '6.5' to those matrices would verify the correct SDK path is exercised for track and purchase events.
index.ts:21 — defaultVersion local const shadows the imported constant (low)
const defaultVersion = DESTINATION_API_VERSION is a pass-through alias. It means defaultVersion and DESTINATION_API_VERSION are two separate names for the same value, with defaultVersion used for the runtime fallback (sdkVersion ?? defaultVersion) and DESTINATION_API_VERSION used in the choices array. If someone bumps DESTINATION_API_VERSION in versioning-info.ts but forgets to re-check index.ts, the choices entry updates but the runtime fallback stays on whatever defaultVersion was last set to. Consider using DESTINATION_API_VERSION directly and removing the alias.
…est names from constants Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
done @arnav777dev |
Summary
Upgrades Braze Web SDK from v6.1 to v6.5.0, made available as an opt-in version selection for customers.
This is a browser-mode destination where customers explicitly select SDK versions from a dropdown. Version 6.5 is now available as a new option while maintaining 6.1 as the safe default for new installations.
JIRA: https://twilio-engineering.atlassian.net/browse/STRATCONN-6776
Changes
Version Management
versioning-info.tswith centralized version constantsBRAZE_SDK_DEFAULT_VERSION = '6.1'(stable default)BRAZE_SDK_CANARY_VERSION = '6.5'(newly available option)Testing
Breaking Changes
NONE - This is a fully backward-compatible upgrade.
Version-by-Version Changes
v6.2.0 (ENHANCEMENTS)
v6.3.0 (ENHANCEMENTS + BUGFIXES)
NotificationSubscriptionTypesinbrazeBridge(new optional API)v6.3.1 (BUGFIX)
v6.4.0 (ENHANCEMENTS + BUGFIXES)
braze.logBannerImpressions()andbraze.logBannerClick()methods (optional)v6.5.0 (ENHANCEMENTS)
cookieExpiryInDaysinitialization option (default: 400 days, backward-compatible)Banner.htmlproperty for manual HTML injection (optional)Testing Plan
Manual Testing Required
Settings loading with 6.5:

Braze 6.5 is loading:

track event is successful:


Automated Testing
Rollout Plan
Since this is a browser-mode destination with explicit version selection:
Risk Assessment
Risk Level: LOW
Rationale:
Files Changed
BRAZE_SDK_DEFAULT_VERSION,BRAZE_SDK_CANARY_VERSION)Additional Notes
https://js.appboycdn.com/web-sdk/6.5/braze.no-module.min.jscookieExpiryInDaysparameter could be exposed to customers in a future release if there's demand🤖 Generated with Claude Code