aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

How to get Channel-type in Lex Request #4133

Closed vsatyav007 closed 4 years ago

vsatyav007 commented 5 years ago

I'm Using ChatBot react component from aws-amplify react to build the frontend.ChatBot communicates with lex and sends a request to lambda. In Lex, I connected it with facebook and Twilio. In Lambda I'm able to access the sessionAttributes.Is there a way to get the channel-type?

Lambda index.js exports.handler = async (event, context, callback) => { try { // 1. Gather information from the current session. let sessionAttributes = event.sessionAttributes || {}; } } Web Application: <ChatBot title="Demo Assistant" theme={myTheme} botName="DemoBot" onComplete={this.handleComplete.bind(this)} welcomeMessage={"Welcome! How may I assist?"} clearOnComplete={true} voiceEnabled={false} conversationModeOn={false} />

Thanks, Satya Veera

vsatyav007 commented 4 years ago

can anyone update me on this?

jkeys-ecg-nmsu commented 4 years ago

@vsatyav007 I think you'll need to take this up with the Lex service team. If the event sent to your validation/fulfillment lambda doesn't contain the attribute you need, there's nothing the Amplify team can do about it until the service team updates the API to include the channel-type in the event.

That being said, is there any reason you can't store the channel-type as a sessionAttribute?

ashika01 commented 4 years ago

@vsatyav007 : Looks like there is much amplify could do here. as @jkeys-ecg-nmsu mentioned, is there a reason for not using sessionAttribute for this?

Do you feel Amplify team could do something more here?

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.