Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/amplitude-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,14 @@ AmplitudeClient.prototype.setOptOut = function setOptOut(enable) {
}
};

/**
* Set a custom Session ID for the current session.
* Note: This is not recommended unless you know what you are doing because the Session ID of a session is utilized for all session metrics in Amplitude.
* The Session ID to set for the current session must be in milliseconds since epoch (Unix Timestamp).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is me just not knowing the exact spec here. Is this req'd or just a suggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually what was previously documented in our Help Center. If this is not req'd, then we can definitely edit the text.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know either. I'll ask the dataPL/Query teams

* @public
* @param {int} sessionId to set.
* @example amplitudeClient.setSessionId(1622158968000);
*/
AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {
if (!utils.validateInput(sessionId, 'sessionId', 'number')) {
return;
Expand Down