How heygen-official/interactiveavatarnextjsdemo works
Main Components
a) Client-Side (Browser)
• Next.js Frontend Application
• Interactive Avatar Component
• Theme Management
• User Interface Elements
b) Server-Side (Next.js API Routes)
• Access Token Generation Service
• Environment Configuration
c) External Services
• HeyGen Interactive Avatar API
• OpenAI API (Optional Integration)
Specific Component Details
• Rectangle (Blue): React/Next.js Components
• InteractiveAvatar
• NavBar
• ThemeSwitch
• Text Input Components
• Hexagon (Green): API Routes
• get-access-token
• HeyGen Interactive Avatar API
• OpenAI API
Key Elements to Highlight
• Authentication Flow:
How the API token from .env flows through the system to authenticate with HeyGen's API
• State Management:
How the application manages avatar sessions and user interactions
• Real-time Communication:
Streaming nature of the avatar interaction
Technical Details
Annotations for:
• Next.js 13+ App Router Architecture
• API Route Implementation
• Environment Variable Configuration
• Third-party Integration Points
Implementation Notes
• Session Management Limits (3 concurrent sessions for Trial Token)
• Authentication Requirements
• Supported Avatar Types
• API Dependencies
Remember to use clear, consistent styling:
• Clear labels for all components and connections