Beta Feature: The Realtime Assistants API is currently in beta. This tutorial uses the latest features available.
What We’ll Build
In this tutorial, we’ll create a voice assistant that can:- Have natural conversations with users
- Execute custom tools (weather lookup, jokes)
- Update its behavior dynamically
- Visualize voice activity in real-time
The complete example code is available on GitHub: react-assistant-demo
Prerequisites
Before starting, you’ll need:- Node.js 16+ installed
- A UpliftAI account (sign up free)
- Basic React knowledge
Step 1: Create Your Assistant
First, let’s create an assistant using the API or the UpliftAI platform.- Using the Platform (Recommended)
- Using the API
- Go to platform.upliftai.org
- Navigate to Assistants → Create New
- Configure your assistant:
- Name: “My First Assistant”
- Instructions: “You are a helpful and friendly assistant”
- Enable “Public Access” for this tutorial
- Copy the Assistant ID
Step 2: Set Up Your React Project
Create a new React application and install the required dependencies:Step 3: Create the Connection Logic
Create a component to handle assistant connection:App.js
Step 4: Build the Assistant Interface
Create the main assistant view with voice visualization:AssistantView.js
Step 5: Add Custom Tools
Extend your assistant with custom functionality:AssistantWithTools.js
Step 6: Dynamic Instruction Updates
Add the ability to change assistant behavior on the fly:DynamicInstructions.js
Step 7: Add Styling
Create a simple stylesheet for your assistant:App.css
Step 8: Test Your Assistant
-
Start your development server:
- Open http://localhost:3000 in your browser
- Enter your Assistant ID and click Connect
-
Start talking! Try:
- “Hello, how are you?”
- “What’s the weather in New York?”
- “Tell me a joke”
- “Can you help me with math?”
Production Considerations
When moving to production, consider:Security
Error Handling
Tool Implementation
Next Steps
Explore Advanced Features
Learn about building complex tools and integrations
View Complete Example
Check out the full example with all features
SDK Reference
Deep dive into the React SDK documentation
Deploy Your Assistant
Learn how to deploy to production
Troubleshooting
Assistant not connecting
Assistant not connecting
- Verify your Assistant ID is correct
- Ensure the assistant is marked as public
- Check browser console for errors
- Verify microphone permissions are granted
No audio from assistant
No audio from assistant
- Check browser audio permissions
- Verify STT, LLM, & TTS configuration in assistant settings
- MAKE SURE the model ids being referred to actually exist.
Tools not executing
Tools not executing
- Ensure tools are properly defined in the configuration
- Check tool handler returns proper JSON format
- Verify timeout values are sufficient
- Check browser console for tool errors
High latency or delays
High latency or delays
- Contact us at founders@upliftai.org, we would love to see how we can improve the experience.
Get support from us
Get support from us
- Contact us at founders@upliftai.org, we would love to see how we can improve the experience or fix any issues you have.
- You can also just tell us about your usecase!
