Lol, I appreciate that and yes I have seen that doc. "I understand the suggestion to use Get User Data with {{ event.userId }}, but this is unrelated to my issue.
I am specifically trying to pass a custom frontend variable (businessId) to my Botpress bot via the Webchat embed script, using the "officially documented" method (userData).
The documentation here clearly states we can send custom frontend data via:
window.botpressWebChat.init({
botId: "
",
clientId: "
",
userData: {
businessId: "12345"
}
});
And retrieve it in Botpress backend via:
javascript
const businessId = event.state.user?.userData?.businessId;
But this officially documented method doesn't actually work on my Botpress Cloud instance, despite multiple exact attempts.
Additionally, newer documentation (botpress.com/docs/user-data) shows an alternative method (user.data). I've also tested that without success.
where I need more clarify:
Is the officially documented userData method working on Botpress Cloud Webchat v2.3?
Has there been an undocumented change to the required data structure (userData vs user.data)?
If both approaches (userData and user.data) fail, how can I reliably pass custom frontend variables into my bot?"