User Data & Logout Info Update
This document provides a quick overview of two key functionalities in the REVE Chat API: updating user information and logging out.
1. User Info Update
The $_REVECHAT_API.User.setVariables function is used to update a user's information in REVE Chat. This function allows setting various attributes, such as the user’s name, phone number, or any other predefined fields.
Syntax:
Parameters:
userData: An object containing user details to be updated. This typically includes fields like "name" and "phone".
successCallback: A function executed after the information is successfully updated.
Example:
In this example:
The user’s name is set to "John".
The user’s phone number is updated to "011111111111".
The successCallback function will be triggered once the update is successful, allowing for further handling or confirmation.
Note: To call this Api REVE Chat widget must be loaded properly in the website. If you want to pass login information you need to pass login information immediately after the widget loaded in the website. On the other hand, you can call the Api to update any information anytime after the script loaded.
2. Logout API
The $_REVECHAT_API.User.logout
function is used to log the user out of the REVE Chat system.
Syntax:
Parameters:
successCallback: A function executed after the logout process is completed.
Example:
Once the user is logged out, the successCallback function will be triggered to confirm the logout or handle any post-logout actions.
Last updated