Learn how to quickly create a Jovo app for the Amazon Alexa and Google Assistant voice platforms in simple steps.
Watch the video here:
We highly recommend using the Jovo CLI if you want to benefit from all the features coming with Jovo. You can find alternatives on our installation page.
Install the Jovo CLI globally with:
$ npm install -g jovo-cli
After successful installation, you should be able to see the Jovo CLI menu by just typing the following into your command line:
$ jovo
You can check the version number (and compare it to the jovo-cli npm package version) with this command:
$ jovo -v
You can create a Jovo project into a new directory with the following command:
// @language=javascript
$ jovo new <directory>
// @language=typescript
$ jovo new <directory> --language typescript
This will create a new folder, download the Jovo "Hello World" template, and install all the necessary dependencies so you can get started right away.
This is how a typical Jovo project looks like:
// @language=javascript
models/
└── en-US.json
src/
|── app.js
|── config.js
└── index.js
project.js
// @language=typescript
models/
└── en-US.json
src/
|── app.ts
|── config.ts
└── index.ts
project.js
To test the logic of your code, you can use the local development server provided by Jovo, and the Jovo Debugger.
To get started, use the following command:
// @language=javascript
# Run local development server
$ jovo run
// @language=typescript
# Run compuler
$ npm run tsc
# Run local development server
$ jovo run
This will start the development server on port 3000
and create a Jovo Webhook URL that can be used for local development. Copy this link and open it in your browser to use the Jovo Debugger.
In the Debugger, you can quickly test if the flow of your voice app works. For this example, click on the LAUNCH
button, and then specify a name on the MyNameIsIntent
button. The Debugger will create requests and run them agains your local webhook.
After getting your first "Hello World," here are the next steps to get started with the Jovo Framework and voice app development.
Take a look at the app.js
file in the src
folder to get an understanding of how the app logic is built:
// @language=javascript
// src/app.js
app.setHandler({
LAUNCH() {
return this.toIntent('HelloWorldIntent');
},
HelloWorldIntent() {
this.ask('Hello World! What\'s your name?', 'Please tell me your name.');
},
MyNameIsIntent() {
this.tell('Hey ' + this.$inputs.name.value + ', nice to meet you!');
},
});
// @language=typescript
// src/app.ts
app.setHandler({
LAUNCH() {
return this.toIntent('HelloWorldIntent');
},
HelloWorldIntent() {
this.ask('Hello World! What\'s your name?', 'Please tell me your name.');
},
MyNameIsIntent() {
this.tell('Hey ' + this.$inputs.name.value + ', nice to meet you!');
},
});
The handler methods that are referenced in the app logic, e.g. HelloWorldIntent
and MyNameIsIntent
, are so called intents that are defined in the app's language model.
Voice platforms offer different types of natural language understanding (NLU) services that offer different schemas. The Jovo Language Model can be used as an abstraction layer that can later be converted into platform-specific models.