{"id":271650,"date":"2025-07-23T04:09:01","date_gmt":"2025-07-23T04:09:01","guid":{"rendered":"https:\/\/www.revechat.com\/?post_type=help-center&#038;p=271650"},"modified":"2025-07-23T04:09:03","modified_gmt":"2025-07-23T04:09:03","slug":"user-data-logout-info-update","status":"publish","type":"help-center","link":"https:\/\/www.revechat.com\/help-center\/user-data-logout-info-update\/","title":{"rendered":"User Data &amp; Logout Info Update"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>This document provides a quick overview of two key functionalities in the REVE Chat API: updating user information and logging out.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">User Info Update<\/h2>\n\n\n\n<p>The <code>$_REVECHAT_API.User.setVariables<\/code> function is used to update a user&#8217;s information in REVE Chat. This function allows setting various attributes, such as the user\u2019s name, phone number, or any other predefined fields.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-javascript\">$_REVECHAT_API.User.setVariables(userData, successCallback);<\/code><\/pre>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>userData: An object containing user details to be updated. This typically includes fields like &#8220;name&#8221; and &#8220;phone&#8221;.<\/li>\n\n\n\n<li>successCallback: A function executed after the information is successfully updated.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-javascript\">$_REVECHAT_API.User.setVariables({\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&quot;name&quot;: &quot;John&quot;,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&quot;phone&quot;: &quot;011111111111&quot;\n}, successCallback);<\/code><\/pre>\n\n\n\n<p><strong>In this example:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The user\u2019s name is set to &#8220;John&#8221;.<\/li>\n\n\n\n<li>The user\u2019s phone number is updated to &#8220;011111111111&#8221;.<\/li>\n<\/ul>\n\n\n\n<p>The successCallback function will be triggered once the update is successful, allowing for further handling or confirmation.<\/p>\n\n\n\n<p><em>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.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Logout API<\/h2>\n\n\n\n<p>The <code>$_REVECHAT_API.User.logout<\/code> function is used to log the user out of the REVE Chat system.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-javascript\">$_REVECHAT_API.User.logout(successCallback);<\/code><\/pre>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>successCallback: A function executed after the logout process is completed.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-javascript\">$_REVECHAT_API.User.logout(function() {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(\u201clogout successfully\u201d)\n});<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Once the user is logged out, the <code>successCallback<\/code> function will be triggered to confirm the logout or handle any post-logout actions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This document provides a quick overview of two key functionalities in the REVE Chat API: updating user information and logging out. User Info Update The $_REVECHAT_API.User.setVariables function is used to update a user&#8217;s information in REVE Chat. This function allows setting various attributes, such as the user\u2019s name, phone number, or any other predefined fields. [&hellip;]<\/p>\n","protected":false},"author":43,"featured_media":0,"menu_order":126,"template":"","meta":{"_acf_changed":false,"footnotes":""},"help_center_type":[1816],"class_list":["post-271650","help-center","type-help-center","status-publish","hentry","help_center_type-javascript-api"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center"}],"about":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/types\/help-center"}],"author":[{"embeddable":true,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/users\/43"}],"version-history":[{"count":1,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271650\/revisions"}],"predecessor-version":[{"id":271652,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271650\/revisions\/271652"}],"wp:attachment":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/media?parent=271650"}],"wp:term":[{"taxonomy":"help_center_type","embeddable":true,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help_center_type?post=271650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}