This repository provides examples using the Houndify Web SDK, which allows you to integrate Voice AI into your web, server, or React Native application.
Here, we've prepared an example website and server using the SDK. This repo doesn't include a React Native demo in the interest of keeping the build process similar. If you're interested in using React Native, check the houndify-react-native repository for more information.
Feel free to explore the code to get a feel for how to use the Houndify Web SDK. If you're looking to do some quick prototyping for your own voice enabled project, this is a great place to start!
- Clone this repository.
- run
npm install
- Add your Client ID and Client Key into the
config.json
file. - Add your Client ID into index.html if you are using the browser. (Search for: [INSERT CLIENT ID BELOW])
- To start the server and website, run
npm start
, or see below for how to run the example command line tools.
This file contains some configuration information for the example project. Open it and enter your clientId/clientKey from your houndify account.
WHENEVER you change your clientId here, also change it in public/index.html
. You can easily find it there by searching for the following text
[INSERT CLIENT ID BELOW]
Please remember that if you'd like to use HTTPS, you must create a SSL key and certificate, and add their locations here.
This is the sample website we've created.
Here, you'll find an example webpage. There's a script tag where we use the Houndify API to make requests and process responses. At the top of the page, we include the houndify web sdk from unpkg:
<script src="https://unpkg.com/houndify@3.1.1/dist/houndify.js"></script>
This library does not directly make requests using the SDK, but sets up some important routes which allow the website to work, as we discussed here. You can run it using
npm start
It will run on whatever port was set up in config.json
, 3446 by default. Use this rather than starting the server directly, it runs some configuration in the background.
These are server-side implementations of Houndify's text and voice query features. If you've read the Web SDK Tutorial. (which we highly recommend you do), you'll see that these files use the API we discussed.
You can run these using the following.
node node-client-text.js --query "What is the weather like in New York?"
node node-client-voice.js --audio ./path/to/audio.wav