Google support ticket - https://www.googlecloudcommunity.com/gc/AI-ML/Pass-JWT-token-paramater-to-Google-Dialogflow/m-p/844505
Based on the Google support response, here's how you can implement this:
- First, pass the JWT token to the chatbot when initializing it. You can do this through custom payload when initializing the messenger:
// Get JWT from localStorage
const jwt = localStorage.getItem('jwt');