This is a mega-repo where you can find various examples demonstrating the functionality of the Voiceflow Runtime Client SDK. React is used in some examples, however, the SDK is framework-agnostic, so the concepts can apply to other frameworks or libraries such as Angular, Vue, or even jQuery.
First, clone this repo, then to setup any example, follow the below steps:
cd samplewheresampleis folder name of the sample you want to try out.- Find the
.vffile in/sample, e.g, thehello-worldfolder has ahello-world.vffile. This file contains a ready-made Voiceflow project which will be integrated with the JavaScript code. - Follow the instructions here to import the
.vffile into Voiceflow and to obtain theVERSION_IDand API keys. - In each sample folder, there is a
config.jsontemplate provided. Paste theVERSION_IDand API keys you copied earlier into the attributes, as described below
{
"versionID": "679812r0fb3husergfde", // replace this with your VERSION_ID
"apiKey" : "VF.62002nffjeUFWQDUu39.hv342wUoqw81234jnswJ231siq" // replace with your apiKey
}- Run
yarnto install any necessary dependencies. - Depending on the project, you can start the project with
node index.jsoryarn start. Check the README.md in the individual samples' folders for any additional setup instructions specific to that project.
Feel free to contribute any sample you feel would be helpful for the user. Please ensure to do the following:
- Create a
config.jsonfile that is loaded into theRuntimeClientFactoryconstructor (if possible). - Create a
.vffile for that sample. - Write a README.md for the sample explaining any unusual setup, usage, or code in your sample.