https://discord.gg/botpress logo
custom userid on init chatbot web
# 🤝help
h
Does Botpress allow you to start a chatbot with a custom user ID, such as using a Google user ID?... I want to change the default ID to Google's so that my user always has the same ID regardless of the browser they are using.
Copy code
javascript
<script>
 
    window.botpressWebChat.init({
        host: "http://localhost:3000",
        botId: "test",
        userId: 'customUserId'
    });
    setTimeout(() => window.botpressWebChat.sendEvent({ type: 'show' }), 1000);
</script>
p
No you cannot do that. You can however tie the google user ID to that new user by sending the data to your bot when it is initialized. Here are the docs about this: https://botpress.com/docs/webchat/interact/send-user-data Hope this helps!
h
Thanks