Skip to content

Commit 3f8c15d

Browse files
authored
docs: Add setSessionId to reference website (#398)
* 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 99aec49 commit 3f8c15d

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
@@ -886,6 +886,14 @@ AmplitudeClient.prototype.setOptOut = function setOptOut(enable) {
886886
}
887887
};
888888

889+
/**
890+
* Set a custom Session ID for the current session.
891+
* 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.
892+
* The Session ID to set for the current session must be in milliseconds since epoch (Unix Timestamp).
893+
* @public
894+
* @param {int} sessionId to set.
895+
* @example amplitudeClient.setSessionId(1622158968000);
896+
*/
889897
AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {
890898
if (!utils.validateInput(sessionId, 'sessionId', 'number')) {
891899
return;

0 commit comments

Comments
 (0)