how to pass eventData in eventRequest of JavaScript Web SDK for Dialogflow?

84 Views Asked by At

After getting uid of the logged user using signInWithPopup. I am passing this uid to dialogflow by event trigger mechanism.

So I have added an event with name "login" and calling using JavaScript Web SDK for Dialogflow like this.

enter image description here

client.eventRequest('login',eventData = {
    "uid" : user.uid,
});

And at fulfillment side I am accessing parameter "uid" like

function loginAction(agent) {
    let user = agent.getContext('user').parameters;
    console.log("logged Uid " + user.uid);
    console.log(JSON.stringify(user));
    agent.add('Welcome');
}

Output in log is like:

logged Uid 
{"uid":"","uid.original":""}

Also in github repo of JavaScript Web SDK for Dialogflow no any example is given for sending parameter with eventRequest()

0

There are 0 best solutions below