Jovo Response Object

Learn more about the Jovo $response object.


Learn more about the Request & Response Lifecycle here.

The $response object offers helpful features to access information from the response that is sent back to the platform (e.g. Amazon Alexa or Google Assistant).

You can access the response object like this:

The response gets assembled from the $output object in the platform.output middleware, and then sent back to the platform in the response middleware.

Cross-Platform Methods

Response Setters

Method Description
setSessionData(sessionData: SessionData) Setts session data. Learn more about session data here.

Response Getters

For some use cases (especially Unit Testing), it might be helpful to get information from a response object, like this.$response.getSpeech().

You can use these cross-platform helper methods:

Method Description
getSpeech(): string Returns speech text without "speak" and tags.
getReprompt(): string Returns reprompt text without "speak" tags.
hasSessionData(name: string, value?: any): boolean Checks if response has a specific session attribute in it.
getSessionData(): SessionData | undefined Returns session data. Learn more about session data here.
hasSessionEnded(): boolean Returns true if session ended
hasState(state: string): boolean Checks if response has state in it

Comments and Questions

Any specific questions? Just drop them below. Alternatively, you can also fill out this feedback form. Thank you!

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.