User Profile
SDK allows You to update default user properties. This values will be saved in user profile and available in bot structure (e.g. {{api_access_key}}
)
If You don't pass properties in the user_profile
property. first_name
, last_name
and profile_pic
values are used in the Inbox.
The Id is generated only when a user first-time visit website. To identify users SDK uses Web Storage API.
Example
<script>
window.initKBWebSDK = function (SDK) {
const bot = SDK.initKBChatbot({
...
"user_profile": {
"first_name": "Frank",
"locale" : "en_US",
"gender": "male",
"api_access_key": "api123"
}
});
}
</script>
Example object
Field | Required | Type | Default | Desc |
---|---|---|---|---|
id | No | string (uuid-v4) | ||
first_name | No | string | ||
last_name | No | string | ||
profile_pic | No | string | ||
locale | No | string | en_US | Based on this property widget load translations. |
{custom_key} | No | string |