Skip to main content

Quick Examples

Basic Voice Chat (React)

A minimal voice chat implementation:

WebSocket Voice Connection

Direct WebSocket implementation:

Real-World Use Cases

1. Customer Support Bot

Emotion-aware customer service with escalation:

2. Educational Voice Tutor

Adaptive learning with emotion-based pacing:

3. Healthcare Voice Assistant

Empathetic health monitoring with privacy considerations:

Integration Patterns

Environment Configuration

Error Boundary


Best Practices Summary

  • Always show connection status clearly to users
  • Provide visual feedback for microphone activity
  • Handle permissions gracefully with helpful instructions
  • Implement loading states and error recovery
  • Test across different devices and browsers
  • Use React.memo for message components
  • Implement virtual scrolling for long conversations
  • Clean up connections when components unmount
  • Optimize audio processing for mobile devices
  • Monitor memory usage with long-running sessions
  • Never expose API keys in client-side production code
  • Use JWT tokens for client authentication
  • Implement proper CORS policies
  • Validate user permissions server-side
  • Use HTTPS for all connections
  • Always inform users about emotion detection
  • Provide options to disable emotion tracking
  • Handle emotional data with appropriate sensitivity
  • Implement data retention policies
  • Consider cultural differences in emotional expression
These examples provide a solid foundation for building sophisticated voice AI applications with NextEVI across different industries and use cases.