I want to pass information to the bot from my website application

My botpress cloud bot is added to my site using webchat js. How can I pass details to the bot like the user_name, user_id, page_url, and other potential user account information which could be used to filter responses in the bot.

1 Like

Thats a great question. I had the same issue and I think is not currently possible to pass details to the bot from the web site.

Hey guys @james @miguel.pardo ,

We are working on something that should be released soon to help you with this.

How important is this feature to you?

Yes for our ultimate goal. I’d like to be able to:

  • Pass a session id or similar to the bot so that within the bot I could authenticate the user through an api call. This api call would allow us to retrieve user name and other aspects to enable us to tailor the results accordingly.
  • Longer term I’m trying to determine if we could use the bot to perform app functions. Based on knowing the user they could type “Please create a record for me with the following details” and we could parse out the appropriate information and perform the action accordingly via api call. Perhaps the iframe strategy isn’t right here and we would be better waiting for your api integration? I’m interested in your views.
  • I’d like to know what page my user is currently on so that I can tailor the conversation accordingly. And perhaps only allow the bot to respond if it’s on certain pages.

@james that sounds fantastic! I will let the team know your feedback.

Meanwhile, you can call APIs using Axios in an Execute Code card.

Hey! Is there any news on this? We need to customize the bot depending on the user (giving context to the bot to ask some questions), but I don’t find a way to send anything to the bot… If I would be able to share any ID I could request any of my APIs on the bot’s workflow, but… seems impossible.


1 Like

Hi, same question. Would like to customize the bot experience based on the user. Is there already any possibility to pass it in the web chat configuration for example?
Thank you!

Hey guys @mauro.gomez @kjetilv ,

It is in our pipeline, and mostly will be part of our following big announcement.