Skip to main content
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.

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

  1. Start your development server:
  2. Open http://localhost:3000 in your browser
  3. Enter your Assistant ID and click Connect
  4. 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

  • Verify your Assistant ID is correct
  • Ensure the assistant is marked as public
  • Check browser console for errors
  • Verify microphone permissions are granted
  • Check browser audio permissions
  • Verify STT, LLM, & TTS configuration in assistant settings
    • MAKE SURE the model ids being referred to actually exist.
  • 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
  • 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!