A trigger with custom payload from the front-end.
It’s a two-part process.
The front end (hosting page/website) must push code to the webchat, which is captured by a trigger in the bot and sets the user variable.
window.botpressWebChat.sendPayload({
type: “trigger”,
payload: {
userName: “Whisky Hangover”
}
}