Start tracking your progress
Trailhead Home
Trailhead Home

Get Started with Violet

Learning Objectives

In this project, you’ll:

  • Learn how voice applications can enhance the Salesforce experience.
  • Set up your computer to run your voice application locally.
  • Build a voice application using the Violet project.

Game Night!

So you’ve decided to host a game night. You just got off a call with a good friend who’s going to help, and you’ve got a rough idea of how the night can go. But you want to take note of the details. 

You decide to turn to a virtual assistant/smart speaker and ask it to help you organize your game night. After answering a few questions and within a few short minutes, your game night is organized. This is just one example of a voice application and is what we will build today.

What Is a Voice Application?

A voice application is an application built for a voice interaction, such as an Alexa Skill or a Google Action. In our case, Violet is designed to let you create voice applications for any voice platform that also links back to your Salesforce instance. Violet provides a conversational engine that abstracts away the complexity of implementation and enables developers to focus on the business logic and conversational flow.

Violet works by helping you split your business logic while managing your conversational flows. There are two main concepts.

  • The first concept builds out the idea of menus, where users can make a series of potentially nested decisions.
  • The second concept is the idea of a form, where users need to provide a number of inputs as a dialog.
Note

Note

Violet is designed to aid in building all kinds of conversational applications. The basic voice scripts require minimal coding, and longer conversations are enabled using reusable flow elements as widgets, externalizing integration logic into plug-ins, and adding application logic in services.

Our application today is a basic voice script, but you can see just how simple it is to get started making voice applications. 

 Set Up Your Development Environment

Violet is a node app on Heroku. To complete this project, you need to have Node v6.x installed.

Note

Note

If you don’t have node v.6.x installed on your machine, take a few minutes to install it by clicking the link above. npm is automatically downloaded and installed with Node.js 

Now you need to create a new folder on your Desktop called Violet-App.

Once you have node and npm installed and your Violet-App folder, you need to initialize a node project and install Violet. You can do this by opening Terminal (Mac) or Command Prompt (Windows) and typing:

  1. cd Desktop/Violet-App
  2. npm init -y
  3. npm install violet --save

It takes a moment to install, but once it’s done you may see + violet@x.x.x as well as a message indicating a number of packages were added. This means the npm violet package was successfully installed. The x.x.x refers to your version. 

Note

Note

You might also see a warning for security vulnerabilities in some of the dependencies, but these should not come into effect in a typical voice script.

Please leave your terminal/command prompt open for the future steps of this project. Now that you’ve successfully set up your environment, you’re ready to get started on building your app.

 Resources

retargeting