Skip to main content

Logout

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

Steps to logout User

  1. Use the logout() function provided by the lmFeedClient object created earlier.
  2. Create an instance of LogoutRequest, as shown in the snippet and pass it to the above method.
  3. Use the response as per your requirement
try {
const logoutRequest = LogoutRequest.builder()
.setRefreshToken("<ENTER_REFRESH_TOKEN>") // refresh token of the user
.setDeviceId("<ENTER_DEVICE_ID>") // unique id of the device
.build();
const response = await lmFeedClient.logout(logoutRequest);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}

Models

LogoutRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
refreshTokenstringRefresh token of the user.
deviceIdstringUnique id of the device.