This repository shows the sample code for our blog "Talking to Your Database," which shows how to use Directus as a data store for an IVR application.
- Directus Account
- Vonage Developer Account
- Node.js 18+
You will also need a tunneling system like ngrok if you want to run the code locally.
- Sign up for a free account at https://developer.vonage.com/sign-up
- Under "Build & Manage", select "Applications"
- Click "Create a new application"
- Give the application a name
- Click "Generate public and private key" to download a new private key for this application
- Enable the Voice API Capabilities
- Enter the URL for your application into the Answer URL, or the ngrok URL if you are using ngrok
- Click "Generate new application" at the bottom
- Under the "Link Numbers" section, click the "Link" button to attach your Vonage Number to this application
- Go to https://docs.directus.io/getting-started/quickstart.html and follow the quick start guide to either set up a Directus Cloud account, or set up Directus to run locally.
- Copy
.env.dist
to.env
- Fill in the variables with the needed information:
- DIRECTUS_INSTANCE - The URL for your Directus install
- DIRECTUS_TOKEN - The token for the user you create as part of the demo
- API_APPLICATION_ID - The Vonage Application ID we created above
- PRIVATE_KEY - A base64 version of the Vonage Private Key we saved earlier
To run the application, open up a terminal and run:
node server.js
Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.
We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
- Open an issue on this repository
- Tweet at us! We're @VonageDev on X
- Or join the Vonage Developer Community Slack