Views and Variables


Views are the Voxa way of handling replies to the user, they’re templates of responses using a simple javascript DSL. They can contain ssml and include cards.

There are 5 responses in the following snippet: LaunchIntent.OpenResponse, ExitIntent.Farewell, HelpIntent.HelpAboutSkill, Count.Say and Count.Tell

Also, there’s a special type of view which can contain arrays of options, when Voxa finds one of those like the LaunchIntent.OpenResponse it will select a random sample and use it as the response.

const views = {
  LaunchIntent: {
    OpenResponse: {
      tell: [
        'Hello! <break time="3s"/> Good  {time}. Is there anything i can do to help you today?',
        'Hi there! <break time="3s"/> Good  {time}. How may i be of service?',
        'Good  {time}, Welcome!. How can i help you?',
  ExitIntent: {
    Farewell: { tell: 'Ok. For more info visit {site} site.' },
  HelpIntent: {
    HelpAboutSkill: {
      tell: 'For more help visit example dot com'
      card: {
        type: 'Standard',
        text: 'Help is available at is',
  Count: {
    Say: { say: '{count}' },
    Tell: { tell: '{count}' },

They come in 3 forms: say, ask and tell.


Tell views send a response to alexa and close the session inmediately. They’re used when the skill is done interacting with the user. The ExitIntent.Farewell is an example of this.


Ask views are used to prompt the user for information, they send a response to alexa but keep the session open so the user can respond. The LaunchIntent.OpenResponse is an ask view.


While the tell and ask view types are an exact representation of the base alexa programming model, the say views are different. They’re an abstraction created by voxa to make it simpler to compose your responses over many state transitions. They don’t send a respond to alexa but instead make a state transition internally and continue executing your skill code until there’s a tell or ask response.


Variables are the rendering engine way of adding logic into your views. They’re dessigned to be very simple since most of your logic should be in your model or controllers.

A variable signature is:

variable(model, alexaEvent)
  • model – The instance of your model for the current alexa event.
  • AlexaEvent – The current alexa event.

The value to be rendered or a promise resolving to a value to be rendered in the view.

const variables = {
  site: function site(model) {
    return Promise.resolve('');

  count: function count(model) {
    return model.count;

  locale: function locale(model, alexaEvent) {
    return alexaEvent.locale;