https://discord.gg/botpress logo
#🤝help
unique id
# 🤝help
q

quaint-accountant-43414

07/10/2023, 5:19 PM
Hello @acceptable-gold-88171 , I need a way to pass a unique id or the userId that botpress creates initially every time the same user starts a new chat. I store the userId on my database the first time a user starts a chat and I want the option of passing that userId to the initialisation of the webchat in order to execute certain api calls based on that userId. Would appreciate anyway I can send custom data or a unique identifier every time the webchat initialises
t

tall-television-31099

07/10/2023, 5:29 PM
I'm trying to do the same thing. Would be so useful!
f

flat-nail-33989

07/10/2023, 7:27 PM
What’s the role of user variables? I was hoping they could be use to store values from first session of the user and then used as some sort or condition in transitions. But, it just doesn’t recognize the user variables to store any data. Anyone tried that?
a

acceptable-gold-88171

07/20/2023, 3:44 PM
I don't think you can pass information from the chat to the botpress without it triggering a message. That would be a great candidate for #1111026806254993459 @mike correct me if i'm wrong
q

quaint-accountant-43414

07/20/2023, 5:28 PM
@acceptable-gold-88171 Thanks for the reply ! I do have another request, can you help me with the implementation of the window.botpressWebchat.sendPayload (sendPayload: ƒ (e,t)) function, like what's the structure of the parameters that need to be passed to make it work ?
a

acceptable-gold-88171

07/24/2023, 3:16 PM
@bright-magazine-792 do we have docs for this (or is the project on npm?)
b

bright-magazine-792

07/25/2023, 7:11 PM
we don't have docs on it yet
are you looking for
{{event.userId}}
?

https://cdn.discordapp.com/attachments/1128012702569205801/1133477035998720040/image.png

can you try this out?
8 Views