Page 1 of 1

Alexa Node.js blog note

Posted: Fri Mar 01, 2019 3:16 pm
by david
This looked interesting... ... th-node-js

"Editor's Note: In this new code deep dive series, we will provide an end-to-end walkthrough of how to implement in-skill purchasing (ISP) in your Alexa skill. We will be using the Premium Hello World Skill (available on GitHub), which is a sample skill that demonstrates how to use ISP features by offering a “Premium Greeting Pack” that greets the customer in a variety of languages like French, Spanish, Hindi, and more. We will explain each line of code as we walk through several scenarios that monetized skills should be able to handle. With each installment of this series, we’ll introduce you to a new ISP product, starting with entitlements (or one-time purchases) in this post. We will explore subscriptions and consumables in future posts. If you'd like, you can follow along by referencing the steps in the GitHub guide to set up the Premium Hello World skill on your developer account."

Re: Alexa Node.js blog note

Posted: Fri Mar 01, 2019 3:53 pm
by james
Interesting how Node is connecting to Alexa base hardware to use it as an operating system; I think that's what might be going on ... instead of a Windows OS it uses the special speech hardware device for direction. I might be wrong..... but also....

if (isUpsellNeeded) {
const upsellMessage = `You don't currently own the Premium Greeting pack. ${premiumProduct[0].summary}. getRandomLearnMorePrompt()}`;

.... now, let me change this a bit to shorten all those long variable names -- same code just made a little smaller ....

if (true) {

const upsell = `Yooo dude !!! . ${product[0].summary}. buymore()

} ` ; <-- not clean code, missing } but that's not the point.

... check out those backticks (`````````) and see how they allow String data and those Data Connection inserts ( the parts inside the "${variable}" ) to be mixed all together.

I realize this doesn't have anything to do with Alexa ... or the base OS hardware ... just a code thing I noticed.