Alexa Node.js blog note

Here, we few, (Edmund, Fabio, David, Mike, Sid, and Robert), in the Spring of 2019, in an introductory Node JavaScript Class, are going to share LINKS, Lessons Learned, and respond to each other in this Forum. NodeJS is just JavaScript that is driven outside the DOM restrictions or the Web Browser (or, of course, any Responsive functions to a API calls or Apps). NodeJS is not a Language, Framework, nor Library. Rather, it's the environment that drives coding. This course constantly returns to the Theory and Syntax that drives JavaScript. And Classes; we can't forget them -- as they form the basis of TypeScript (which is class based JavaScript). Welcome all. We are here learn about what and "how" Node JavaScript works.
Post Reply
Posts: 5
Joined: Mon Aug 06, 2018 1:20 pm

Alexa Node.js blog note

Post by david » Fri Mar 01, 2019 3:16 pm

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."

User avatar
Posts: 148
Joined: Mon Apr 16, 2018 1:03 pm

Re: Alexa Node.js blog note

Post by james » Fri Mar 01, 2019 3:53 pm

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.

Post Reply