
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@ask-utils/handlers
Advanced tools
[](https://badge.fury.io/js/%40ask-utils%2Fhandlers) [](https://opensource.org/licenses/MIT) [, you can delete a persistent attributes of the user who disabled your skill.
import * as Alexa from 'ask-sdk'
import { DeleteDisabledUserHandler } from '@ask-utils/handlers'
...
export const handler = Alexa..SkillBuilders.standard()
.addRequestHandlers(
...,
DeleteDisabledUserHandler
)
.lambda()
Simple handler for SessionEndedRequest.
import * as Alexa from 'ask-sdk'
import { SessionEndedRequestHandler } from '@ask-utils/handlers'
...
export const handler = Alexa..SkillBuilders.standard()
.addRequestHandlers(
...,
SessionEndedRequestHandler
)
.lambda()
Simple handler for AMAZON.RepeatIntent.
The handler will return session attributes object as lastResponse.
You can easy set the lastResponse attributes into the sessionAttributes by using the RecordTheResponseInterceptor.
import * as Alexa from 'ask-sdk'
import { RecordTheResponseInterceptor, RepeatIntent } from '@ask-utils/handlers'
...
export const handler = Alexa..SkillBuilders.standard()
.addRequestHandlers(
...,
RepeatIntent
)
.addResponseInterceptors(
...,
RecordTheResponseInterceptor
)
.lambda()
You can easy to create a Alexa request handler
import { RequestHandlerFactory } from '@ask-utils/handlers'
const LaunchRequestHandler = RequestHandlerFactory.create(
'LaunchRequest',
{
handle (handlerInput) {
return handlerInput.responseBuilder.speak('hello world').getResponse()
}
}
)
Record the launch count and last launched timestamp. The interceptor will work only new session.
|Name|type||default|description| |:--|:--|:--| |lastLaunch|number?|undefined|Last launch time (UNIX timestamp)| |launchCount|number|0|Launch the skill count.|
import * as Alexa from 'ask-sdk'
import moment from 'moment'
import { SetLaunchCountInterceptor } from '@ask-utils/handlers'
...
export const handler = Alexa..SkillBuilders.standard()
.addRequestHandlers(
{
canHandle: () => true,
handle: (handlerInput) => {
const {
launchCount,
lastLaunch
} = handlerInput.attributesManager.getSessionAttributes()
const lastLaunchDate = moment.unix(lastLaunch).toISOString()
...
}
}
)
.addRequestInterceptors(
...,
SetLaunchCountInterceptor
)
.lambda()
You can inject your skill constants to use requestAttributes.
import * as Alexa from 'ask-sdk'
import { ConstantsInterceptorFactory } from '@ask-utils/handlers'
const ConstantsInterceptor = ConstantsInterceptorFactory.init({
SKILL_NAME: 'awesome skill',
STATE: {
START: 'START',
HELP: 'HELP'
}
})
...
export const handler = Alexa..SkillBuilders.standard()
.addRequestHandlers(
{
canHandle: () => true,
handle: (handlerInput) => {
const {
CONSTANTS
} = handlerInput.attributesManager.getRequestAttributes()
const speech = `Welcome to the ${CONSTANTS.SKILL_NAME} skill!`
...
}
}
)
.addRequestInterceptors(
...,
ConstantsInterceptor
)
.lambda()
Record the response JSON into the session attributes.
If you use handler to handle AMAZON.RepeatIntent, you must use it.
import * as Alexa from 'ask-sdk'
import { RecordTheResponseInterceptor } from '@ask-utils/handlers'
...
export const handler = Alexa..SkillBuilders.standard()
.addResponseInterceptors(
...,
RecordTheResponseInterceptor
)
.lambda()
FAQs
[](https://badge.fury.io/js/%40ask-utils%2Fhandlers) [](https://opensource.org/licenses/MIT) [
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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.