acceptable-kangaroo-64719
10/24/2023, 10:18 AMjs
<script src="https://cdn.botpress.cloud/webchat/v0/inject.js"></script>
<script>
window.botpressWebChat.init({
"composerPlaceholder": "Chat with bot",
"botConversationDescription": "This chatbot was built surprisingly fast with Botpress",
"botId": "5fcacb4c-baae-4061-a258-0a7d47b060d3",
"hostUrl": "https://cdn.botpress.cloud/webchat/v0",
"messagingUrl": "https://messaging.botpress.cloud",
"clientId": "5fcacb4c-baae-4061-a258-0a7d47b060d3",
"lazySocket": true,
"frontendVersion": "v0",
"useSessionStorage": true,
"enableConversationDeletion": true,
"showPoweredBy": true,
"theme": "prism",
"themeColor": "#2563eb",
"userData":{
"name":"Gordy",
"discordUsername":"GordyNumberOne"
}
});
</script>
Then the "get user info" card, as configured in the screenshot, will return
js
{
"name":"Gordy",
"discordUsername":"GordyNumberOne"
}
you will have to use event.userId
, which is automatically generated, to get the data.