Overview
@navai/voice-backend provides backend infrastructure for Navai voice applications. It handles two core responsibilities:
- Minting secure ephemeral
client_secrettokens for OpenAI Realtime API - Discovering, validating, exposing, and executing backend tools from your codebase
Prerequisites
Node.js Version
- Node.js 18.x or later recommended
Peer Dependencies
You must have Express installed in your project:- express:
^4.18.0or^5.0.0
Installation
Install Peer Dependencies
If you don’t already have Express installed:Environment Variables
Create a.env file in your project root with the following variables:
Quick Start
Add Navai routes to your Express application:Registered Routes
TheregisterNavaiExpressRoutes function automatically registers these endpoints:
POST /navai/realtime/client-secret- Mint ephemeral client secretsGET /navai/functions- List available backend toolsPOST /navai/functions/execute- Execute backend tools
Verification
Test your installation by checking the health of your backend routes:Next Steps
Backend Configuration
Configure backend options, security policies, and function discovery
Backend Tools
Learn how to create and expose backend tools for your voice agent
Client Secret Flow
Understand the client secret authentication flow
API Reference
Explore the full backend API documentation