Skip to main content

Logout User

To disconnect a user (say that you’re for instance logging out and logging in as someone new) you can call the logout() method present in LMChatClient class.

Logging out

  1. For an user to logout, use the logout() method of the client you initialised.
  2. Pass in the refreshToken which is a required parameter.
  3. Process the response as per your requirement.
const payload: any = {
refreshToken: 'aajhsdhsadhjsa';
};

const response = await lmChatClient.logout(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Logout User Payload

List of parameters supported.

VariableTypeDescriptionOptional
refreshTokenstringrefreshToken of user logged in

Logout User Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure