This project demonstrates how to:
- Set up a basic (Node) Express server to receive webhook events from Hume's Empathic Voice Interface (EVI).
- Handle
chat_started
andchat_ended
webhook events. - Process events to create workflows, such as generating transcripts or logging session details.
Key Features:
- Webhook integration: Configurable endpoint to receive real-time events.
- Event handling: Parse and process
chat_started
andchat_ended
events with Python utilities. - Extensibility: A base framework for building advanced workflows triggered by EVI events.
To run this project locally, ensure your development environment meets the following requirements:
To check the versions of pnpm
and Node.js
installed on a Mac via the terminal, you can use the following commands:
- For Node.js, enter the following command and press Enter:
node -v
This command will display the version of Node.js currently installed on your system, for example, v21.6.1
.
- For pnpm, type the following command and press Enter:
pnpm -v
This command will show the version of pnpm
that is installed, like 8.10.0
.
If you haven't installed these tools yet, running these commands will result in a message indicating that the command was not found. In that case, you would need to install them first. Node.js can be installed from its official website or via a package manager like Homebrew, and pnpm
can be installed via npm (which comes with Node.js) by running npm install -g pnpm
in the terminal.
- Obtain Your API Key: Follow the instructions in the Hume documentation to acquire your API key.
- Create a
.env
File: In the project's root directory, create a.env
file if it doesn't exist. Add your API key:
HUME_API_KEY="<YOUR_API_KEY>"
Refer to .env.example
as a template.
Install the required dependencies with pnpm: pnpm install
Start the Express server by running the main.ts
file:
pnpm start
Use ngrok or a similar tool to expose your local server to the internet:
ngrok http 5000
Copy the public URL generated by ngrok and update your webhook configuration in the Hume Config:
- Webhook URL:
<NGROK_PUBLIC_URL>/hume-webhook
- Events: Subscribe to
chat_started
andchat_ended
.
- Webhook Endpoint: The Express server listens for POST requests at
/hume-webhook
. - Event Processing:
chat_started
: Logs session details or triggers workflows.chat_ended
: Processes chat data to generate transcripts or perform analytics.
- Custom Logic: Extend the event handler functions in
main.ts
to integrate with your systems.