Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

newuser-7d1855e7-7dad-4175-a42c-49f3e9802854 avatar image

Starting Phrase of skill: just the invocation name

Hello,

I am trying to write a skill in js that is being onvoked like

Alexa, <invocation name>

(and not by Alexa, start <invocation name>"

Actually I fail.

This is what i have (I built it upon some examples).

I thought (according to https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/supported-phrases-to-begin-a-conversation#invoking-a-skill-with-no-specific-request-no-intent) that the launchRequest is fired with above-mentioned invocation. But I cannot hear a "Launch".

Do you have any ideas/examples for me?

Thank you in advance,

Patrick

// Extend AlexaSkill 
CustomSkill.prototype = Object.create(AlexaSkill.prototype); 
CustomSkill.prototype.constructor = CustomSkill;

// ----------------------- Override AlexaSkill request and intent handlers -----------------------
 CustomSkill.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {
    console.log("onSessionStarted requestId: " + sessionStartedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any initialization logic goes here
};
 CustomSkill.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {
    console.log("onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);	

	var speechOutput = "Launch";
        response.tell(speechOutput);
};
 CustomSkill.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {
    console.log("onSessionEnded requestId: " + sessionEndedRequest.requestId
        + ", sessionId: " + session.sessionId);
    // any cleanup logic goes here
};


CustomSkill.prototype.intentHandlers = {
    "CustomSkill": function (intent, session, response) {
      
        doSomething();
    },

    "AMAZON.HelpIntent": function (intent, session, response) {
	var speechOutput = "Help";
        response.tell(speechOutput);

    },

    "AMAZON.StopIntent": function (intent, session, response) {
        var speechOutput = "Goodbye";
        response.tell(speechOutput);
    },

    "AMAZON.CancelIntent": function (intent, session, response) {
        var speechOutput = "Goodbye";
        response.tell(speechOutput);
    }
};
alexa skills kitskillintentsupdate
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered

The documentation you linked to is talking about launching a skill and invoking an intent at the same time. If you want to hear your welcome response, just open your skill without adding an extra intent.

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Jamie,

the link was about invocating a skill without an intent by just saying "Alexa, <invocation name>", based on your documentation this is officially supported.

0 Likes 0 ·
Jamie Grossman avatar image Jamie Grossman ♦♦ 0c443049-7b92-4256-a276-f42c0679df0f commented ·

Oh, it is now! Great! Let me edit my answer.

0 Likes 0 ·
davorin avatar image
davorin answered

Hmm..how would you actually write the interaction model for the LaunchRequest?

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image Jamie Grossman ♦♦ commented ·

You don't. It should be part of your skill code and it's hit when the user opens the skill without making an intent at the same time.

0 Likes 0 ·