unique id
# 🤝help
q
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
I'm trying to do the same thing. Would be so useful!
f
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
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
@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
@bright-magazine-792 do we have docs for this (or is the project on npm?)
b
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?
23 Views