From c47c6f44ac88e95c2562f3b99f1089cf70895e43 Mon Sep 17 00:00:00 2001 From: jarrenpatao Date: Thu, 27 May 2021 17:46:42 -0700 Subject: [PATCH] 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 --- src/amplitude-client.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index 9bcf3b1f..d96ea87c 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -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). + * @public + * @param {int} sessionId to set. + * @example amplitudeClient.setSessionId(1622158968000); + */ AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) { if (!utils.validateInput(sessionId, 'sessionId', 'number')) { return;