
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ask-utils/isp
Advanced tools
NPM: https://www.npmjs.com/package/@ask-utils/isp
Alexa ISP (In Skill Purchasing) helpers. Easy, Shot, Simply.
$ npm i -S @ask-utils/isp
We have to take care of a lot of case to make a buy request.
import { getLocale } from 'ask-sdk-core'
const beforeISPUtils = {
handle() {
return true
},
async handler(handlerInput) {
if (!handlerInput.serviceClientFactory) throw new Error('No service client')
const client = handlerInput.serviceClientFactory.getMonetizationServiceClient()
const { inSkillProducts } = await client.getInSkillProducts(getLocale(handlerInput.requestEnvelope))
if (!inSkillProducts) throw new Error('No product')
const product = inSkillProducts.find(product => product.name === 'YOUR_PPRODUCT_NAME')
if (!product) throw new Error('no product')
return handlerInput.responseBuilder
.addDirective({
'type': 'Connections.SendRequest',
'name': 'Buy',
'payload': {
'InSkillProduct': {
'productId': product.productId
}
},
'token': 'correlationToken'
})
.getResponse()
}
}
We just call our client. Don't have to find or filter API response lists.
import { ISPProductClient, getBuyProductDirective } from '@ask-utils/isp'
const afterISPUtils = {
handle() {
return true
},
async handler(handlerInput) {
const client = new ISPProductClient(handlerInput)
const product = await client.searchProduct({
productName: 'YOUR_PPRODUCT_NAME'
})
if (!product) throw new Error('no product')
return handlerInput.responseBuilder
.addDirective(getBuyProductDirective(product.productId))
.getResponse()
}
}
If start a new Session, it call ISP API to get your products and set to the session attributes. The idea is from this blog post. https://developer.amazon.com/ja/blogs/alexa/post/75ee61df-8365-44bb-b28f-e708000891ad/how-to-use-interceptors-to-simplify-handler-code-and-cache-product-and-purchase-information-in-monetized-alexa-skills
import { loadISPDataInterceptor } from '@ask-utils/isp'
// add interceptor
.addRequestInteceptor(loadISPDataInterceptor)
You can get the products by the following code.
// get product from session attributes
import { getAllEntitledProducts } from '@ask-utils/isp'
const { inSkillProducts } = handlerInput.attributesManager.getSessionAttributes()
const entitledProducts = getAllEntitledProducts(inSkillProducts)
You can add several handlers for ISP request.
import { SkillBuilders } from 'ask-sdk'
import {
ISPHandlers,
loadISPDataInterceptor
} from '@ask-utils/isp'
SkillBuilders.standard()
.addRequestHandlers(
...ISPHandlers,
)
.addRequestInterceptors(
loadISPDataInterceptor
)
.lambda()
$ git clone git@github.com:ask-utils/isp.git
$ cd isp
$ npm i
$ npm test
$ npm run lint
or
$ npm run lint -- --fix
-> Release Note
| Name | Version |
|---|---|
FAQs
Alexa ISP utilities
We found that @ask-utils/isp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.