Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- Node.js and a working React Native environment (Android Studio and/or Xcode).
- Python 3.11+ installed on your device.
You need a Zero Runtime account to generate a token. The agent reaches the Gemini Live API through the Zero Runtime Inference Gateway, so you don’t need a separate Google API key.
Generate a token from the Zero Runtime Dashboard.
Project Structure
First, create an empty project usingmkdir folder_name in your preferred location for the React Native frontend. Your final project structure should look like this:
root
android
ios
App.js
constants.js
index.js
agent-react-native.py
.env
android/: Contains the Android-specific project files.ios/: Contains the iOS-specific project files.App.js: The main React Native component, containing the UI and meeting logic.constants.js: Stores the token and meeting ID for the frontend.index.js: The entry point of the React Native application, where the SDK is registered.agent-react-native.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for the Python agent’s API keys.
1. React Native Frontend
Step 1: Create the app and install the SDK
Create a React Native app and install the React Native SDK:
Step 2: Configure the Android project
Add the required permissions in the Link the necessary native dependencies:Include the following line in your In your
AndroidManifest.xml file.android/app/src/main/AndroidManifest.xml
android/app/build.gradle
android/settings.gradle
MainApplication.kt
android/gradle.properties
proguard-rules.pro file (optional, only if you are using Proguard):android/app/proguard-rules.pro
build.gradle file, update the minimum OS/SDK version to 23:android/build.gradle
Step 3: Configure the iOS project
Ensure that you are using CocoaPods version 1.10 or later. To update CocoaPods, reinstall the gem using
sudo gem install cocoapods.react-native-webrtc in your Podfile:ios/Podfile
react-native-webrtc doesn’t support earlier versions: platform :ios, '12.0'.Install the pods:Info.plist (located at project folder/ios/projectname/info.plist):ios/MyApp/Info.plist
Step 4: Register the service and configure credentials
Register the SDK services in your root Create a meeting room using the Zero Runtime API:Copy the
index.js file for the initialization service.index.js
roomId from the response and create a constants.js file to store your token and meeting ID.constants.js
Step 5: Build the UI and wire up MeetingProvider
App.js
2. Python AI Agent
Step 1: Setup the project
Use Python 3.11 or higher, then install the Zero Runtime Agents SDK. Create and activate a virtual environment, then install
zrt and python-dotenv. Every provider plugin ships with zrt.Step 2: Configure environment variables
Create a
.env file in your project root to store your token securely for the Python agent:.env
Step 3: Create the AI agent backend
Create the Python AI agent (
agent-react-native.py) that joins the same meeting room and interacts with users through voice.agent-react-native.py
3. Run the Application
Step 1: Start the React Native app
Step 2: Run the AI agent
Open a new terminal, activate your virtual environment, and run the Python agent. It reads
ZERORUNTIME_AUTH_TOKEN from the .env file.Step 3: Connect and interact
-
Join the meeting from the app:
- Tap the Join button in the app.
- Allow microphone permissions when prompted.
-
Agent connection:
- Once you join, the Python agent detects your participation.
- You should see “Participant joined” in the terminal.
- The AI agent greets you and initiates the game.
-
Start playing:
- The agent guides you through a number guessing game (1–100).
- Use your microphone to interact with the AI host.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure both the React Native app and the agent are running.
- Check that the meeting ID matches in
constants.jsandagent-react-native.py. - Verify your Zero Runtime token is valid.
Audio not working
Audio not working
- Check device/simulator permissions for microphone access.
Agent not responding
Agent not responding
- Verify your
ZERORUNTIME_AUTH_TOKENis set in the.envfile and is valid.
Next Steps
Quickstart Example
Complete working example with source code.
Build Your First Voice Agent
Learn the Cascade and Realtime pipelines in depth.