The "get user info" card is for bots embedded in a...
# 💻developers
a
The "get user info" card is for bots embedded in a website where the website passes special information to the bot. This special information has to be done manually using the "configurable" script. For example, if you embed your bot in your website with this script:
Copy code
js
<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
Copy code
js
{
"name":"Gordy",
"discordUsername":"GordyNumberOne"
}
you will have to use
event.userId
, which is automatically generated, to get the data.