https://discord.gg/botpress logo
(Wordpress) Issue with sessionReset Payload: custo...
# 🤝help
f
I'm currently integrating Botpress Webchat (v2.4) with my WooCommerce site. I'm trying to pass the customerId of the logged-in user from WordPress to Botpress using the sessionReset event payload. On the WordPress side, the value is correctly assigned. I've confirmed via console.log(window.botpressCustomerId) that the value is set (e.g. 361) before sending the sessionReset. Here's the relevant part of the script: window.botpressCustomerId = 361; window.botpressWebChat.sendEvent({ type: 'sessionReset', payload: { email: window.botpressUserEmail || '', customerId: window.botpressCustomerId || 0 } }); However, when accessing event.payload.customerId in Botpress (in an Incoming Event trigger or a custom code action), the value is either 0 or undefined. I've added timeouts and ensured the event is triggered after webchatLoaded, and other payload values like email are received correctly — only customerId is not being captured. const customerId = event.payload?.customerId || 0; Is there a known issue with passing custom payload keys in sessionReset, or is there an additional configuration required? Thanks in advance for your help.
p
Why is your customerId not in the payload you're sending? Also can you point out the documentation you've found on the sessionReset type you are using? What is its expected behaviour?
f
Solved!
2 Views