Creates a new Alexa emulator
The URL the skill is listening that this emulator should interact with
The path to the intent schema file - defaults to BSTAlexa.DefaultIntentSchemaLocation.
The path to the samples utterances file - defaults to BSTAlexa.DefaultSampleUtterancesLocation.
The application ID. Just makes one up if none is defined.
Emulates the specified intent coming from the Alexa device.
The name of the intent - must exactly match the IntentSchema
A key-value dictionary of slots in the form { "slotName": "slotValue" }
Returns any error, along the response and request JSON associated with this call
Itself
Emulates the specified skill being launched
Returns any error, along the response and request JSON associated with this call
Itself
Registers a callback for Skill events
For AudioPlayer events, the payload is an AudioItem
For event type BSTAlexaEvents.Response, the payload is the response body as JSON A second parameter with the body of the request as JSON is also passed
Itself
Registers a one-time callback for Skill events
For AudioPlayer events, the payload is an AudioItem
For event type BSTAlexaEvents.Response, the payload is the response body as JSON A second parameter with the body of the request as JSON is also passed
Itself
Emulates the current track playing to completion.
The Alexa Emulator will automatically play the next queued track as well as signal to your skill the current track has completed
@param callback Returns any error, along the response and request JSON associated with this call @returns Itself
Triggers a AudioPlayer.PlaybackNearlyFinished request from Alexa
Returns any error, along the response and request JSON associated with this call
Itself
Emulates the track being played back
Updates the offset time on the track
Itself
Triggers a AudioPlayer.PlaybackStopped request from Alexa
Returns any error, along the response and request JSON associated with this call
Itself
Ends the session - requires a reason
Can be ERROR, EXCEEDED_MAX_REPROMPTS or USER_INITIATED
Returns any error, along the response and request JSON associated with this call
Itself
Emulates the specified phrase being said to an Alexa device.
To send an utterance that uses slots, surround the slot variables like so: {MySlotValue}
For example, if the sample utterance was defined as:
HelloWorld Hello world, my name is {Name}
Then the call would be:
alexa.spoken("Hello World, my name is {John}");
Returns any error, along the response and request JSON associated with this call
Itself
Start the emulator
Passes back an error if there are any issues with initialization
Turns off the Alexa emulator. Useful for running inside of tests to ensure all cleanup has completed before next test starts.
Generated using TypeDoc
Programmatic interface for interacting with the Bespoken Alexa emulator.
We have moved this functionality to its own repo, Bespoken Virtual Alexa
Please use that for new development.
This class will be removed in future versions to be replaced by calls to that library
Overview on usage can be found here. NodeJS tutorial here