alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Documentation wrong alexa.appId = appId; #150

Closed pursual closed 6 years ago

pursual commented 7 years ago

alexa.appId = appId; has slowly stopped working on a number of my skills. Apparently the correct format is: alexa.APP_ID = appId;

The old format used to work, and is widely quoted on the web, but is no longer reliable. https://medium.com/@sadranyi/errormessage-invalid-applicationid-amzn1-ask-skill-xxxxxxx-7cefd8478d17

ryhinchey commented 7 years ago

I can confirm this as well. I created a PR to update the Readme

gadgetchnnel commented 7 years ago

Looking at the source code, it still has the property as appId and not APP_ID. I think what you are seeing is issue #147 where the Service Simulator is sending the wrong application id (sending the string "applicationId") and breaking verification, this has been reported over at the developer forums and Amazon are aware of it. I think this reason why switching back to APP_ID is working for you is because this is effectively disabling verification of the application id, as alexa.appId is then undefined.

pursual commented 7 years ago

The skill actually stopped working on devices, until the appId check was removed. It had previously worked. I'm not sure what is going on.

jeffreyisham commented 7 years ago

My app gives an application id warning when I use APP_ID and appId generates a build error.

OezlemYi commented 6 years ago

alexa.applicationId = '' worked for me

tianrenz commented 6 years ago

Hi, Current SDK has remove the appId check for cases when appId is not assigned value and instead throw a warning in the console. I'm closing this for now. Please feel free to reopen if issue persists.

MickL commented 6 years ago

alexa.appId, as described in the readme, is definitely not working. Changing it to APP_ID does work. Anyway i get a warning that the application id is not set. So i add BOTH: APP_ID and appId. Please update the readme @Amazon-tianrenz

kitingChris commented 6 years ago

Would be good to know how it is done correctly? In the lambda config I set the skillID. How can I access and use it in my code without hardcoding it? Would be really nice to know @Amazon-tianrenz

tianrenz commented 6 years ago

The skillId configuration in lambda console works exactly the same as the APP_ID check in the SDK. You won’t need to configure both. They all check if the value supplied matches with what the event json has(which means the lambda is invoked through Alexa skills kit service )

kitingChris commented 6 years ago

@Amazon-tianrenz using the APP_ID variable did not work with the latest sdk. Got an error using that.

Leaving it empty works but produces warnings.

But I discovered I could use it like this:

alexa.appId = event.session.application.applicationId;

But still unsure how it is intended to be used correctly.