feat: Implements Global Session ID#1217
Merged
JordanClemons merged 3 commits intopaypal:developfrom Sep 2, 2025
Merged
Conversation
Comment on lines
170
to
183
| if (__MESSAGES__.__TARGET__ === 'SDK') { | ||
| const globalSessionID = getSDKGlobalSessionID(); | ||
|
|
||
| if (globalSessionID) { | ||
| return globalSessionID; | ||
| } else { | ||
| const globalSessionIDValue = createBelterID(); | ||
| setSDKGlobalSessionID(globalSessionIDValue); | ||
|
|
||
| return globalSessionIDValue; | ||
| } | ||
| } else { | ||
| return undefined; | ||
| } |
Contributor
There was a problem hiding this comment.
we can update 171 to use a let so we can re-assign the variable to prevent creating another variable. something like this:
let globalSessionID = getSDKGlobalSessionID();
if (!globalSessionID) {
globalSessionID = createBelterID();
setSDKGlobalSessionID(globalSessionID);
}
return globalSessionID;
Contributor
Author
There was a problem hiding this comment.
Thanks Rene, Ive made the update in latest commit.
paypal-rosman
approved these changes
Aug 18, 2025
Seavenly
approved these changes
Aug 21, 2025
src/utils/sdk.js
Outdated
|
|
||
| return globalSessionID; | ||
| } else { | ||
| return undefined; |
Collaborator
There was a problem hiding this comment.
I mentioned we could just leave this as undefined. Let's actually just use the same fallback as getSessionID, so getStorage().getSessionID(). They can be the same value that's fine.
Contributor
Author
There was a problem hiding this comment.
Thanks Nate, Ive made the update.
github-actions bot
pushed a commit
that referenced
this pull request
Sep 2, 2025
## [1.71.0](v1.70.0...v1.71.0) (2025-09-02) ### Features * Implements Global Session ID ([#1217](#1217)) ([af2d6e1](af2d6e1))
|
🎉 This PR is included in version 1.71.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Screenshots
Passes global_session_id to logger for tracking

Testing instructions
Validated sdk via cdn stage bundle as well as downstream internal applications to accept the event for tracking purposes