Skip to content

Commit c47c6f4

Browse files
authored
docs: Add setSessionId to reference website (#397)
* Added example and description for setSessionId method * Pulled off master to update to latest version * Fixing accidental deletion of a letter for setOptOut
1 parent 79585d5 commit c47c6f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/amplitude-client.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,14 @@ AmplitudeClient.prototype.setOptOut = function setOptOut(enable) {
974974
}
975975
};
976976

977+
/**
978+
* Set a custom Session ID for the current session.
979+
* 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.
980+
* The Session ID to set for the current session must be in milliseconds since epoch (Unix Timestamp).
981+
* @public
982+
* @param {int} sessionId to set.
983+
* @example amplitudeClient.setSessionId(1622158968000);
984+
*/
977985
AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {
978986
if (!utils.validateInput(sessionId, 'sessionId', 'number')) {
979987
return;

0 commit comments

Comments
 (0)