How to use the ask-sdk.ImageHelper function in ask-sdk

To help you get started, we’ve selected a few ask-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robm26 / travel-browser / lambda / custom / index.js View on Github external
say += `Here is your audio message, <audio src="${constants.bucketUrlPath}${sessionAttributes.audioClip}">`;

        }
        say += ' Say help to hear some options, or say browse cities. ';

        const responseBuilder = handlerInput.responseBuilder;

        const DisplayImg1 = constants.getDisplayImg1();
        const DisplayImg2 = constants.getDisplayImg2();

        if (helpers.supportsDisplay(handlerInput)) {
            const myImage1 = new Alexa.ImageHelper()
                .addImageInstance(DisplayImg1.url)
                .getImage();

            const myImage2 = new Alexa.ImageHelper()
                .addImageInstance(DisplayImg2.url)
                .getImage();

            const primaryText = new Alexa.RichTextContentHelper()
                .withPrimaryText('Welcome to the skill!')
                .getTextContent();

            responseBuilder.addRenderTemplateDirective({
                type : 'BodyTemplate2',
                token : 'string',
                backButton : 'HIDDEN',
                backgroundImage: myImage2,
                image: myImage1,
                title: helpers.capitalize(invocationName),
                textContent: primaryText,
            });</audio>
github robm26 / travel-browser / lambda / index / index.js View on Github external
say += `To book travel here, use airport code ${airportCode}. `;
            cardText += `To book travel here, use airport code ${airportCode}.\n`;

        }
        const description = data.getDescription(city);
        say += description || ``;

        const img = data.getImgUrl(city);

        if (helpers.supportsDisplay(handlerInput)) {

            const myImage1 = new Alexa.ImageHelper()
                .addImageInstance(img)
                .getImage();

            const myImage2 = new Alexa.ImageHelper()
                .addImageInstance(img)
                .getImage();

            const primaryText = new Alexa.RichTextContentHelper()
                .withPrimaryText(`Here is ${city}!`)
                .getTextContent();

            responseBuilder.addRenderTemplateDirective({
                              type: 'BodyTemplate6',
                              token: 'string',
                              backButton: 'HIDDEN',
                              backgroundImage: myImage2,
                              image: myImage1,
                              title: helpers.capitalize(invocationName),
                              textContent: primaryText
                        });

ask-sdk

Standard distribution package for Alexa Skills Kit SDK

Apache-2.0
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis