Push a User Attribute via the webchat SDK.
In order to push an attribute, its name must have been declared in the whitelist configured in the API settings of your bot.
![Capture d’écran 2019-04-10 à 10.32.57.png 1337](https://files.readme.io/9d48d02-Capture_decran_2019-04-10_a_10.32.57.png)
You can push an attribute and ignore request result.
window.ClustaarWebchat.pushAttribute('city', 'Paris');
Or you can push an attribute with a promise, in order to know if the call was successful.
The returned attribute is a boolean.
window.ClustaarWebchat.pushAttribute('city', 'Paris').then(function(ok){
// "ok" is a boolean: true if the attribute is whitelisted and has been set successfully
console.log(ok);
});
Important
If you want this piece of code to run in IE11 (which does not support much of ES6 at all), then you need to get a 3rd party promise library :