# How to send data from Python agent to React frontend for navigation

**URL:** https://community.livekit.io/t/how-to-send-data-from-python-agent-to-react-frontend-for-navigation/164
**Category:** Agents
**Tags:** agent-development, react-components
**Created:** [January 21, 2026, 1:37pm UTC](https://community.livekit.io/t/how-to-send-data-from-python-agent-to-react-frontend-for-navigation/164 "2026-01-21T13:37:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![LiveKit-Community](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/livekit-community/32/67_2.png) [@LiveKit-Community](https://community.livekit.io/u/LiveKit-Community)
#### Post date: [January 21, 2026, 1:37pm UTC](https://community.livekit.io/t/how-to-send-data-from-python-agent-to-react-frontend-for-navigation/164/1 "2026-01-21T13:37:03Z")

</div>

_This question originally came up in our Slack community and the thread has been consolidated here for long-term reference._

How can I send a website URL from my Python LiveKit agent to my React frontend so that React can automatically navigate the user to that website?

When the AI agent decides on a website (e.g., `https://example.com`), I want to send that URL to the React app, and then React should navigate to that page.

---

<div class="post-metadata">

### Author: ![LiveKit-Community](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/livekit-community/32/67_2.png) [@LiveKit-Community](https://community.livekit.io/u/LiveKit-Community)
#### Post date: [January 21, 2026, 1:37pm UTC](https://community.livekit.io/t/how-to-send-data-from-python-agent-to-react-frontend-for-navigation/164/2 "2026-01-21T13:37:06Z")

</div>

Use RPC (Remote Procedure Calls) to send messages between your agent and frontend:

1. **Send a message from your agent to the front end over RPC** : RPC is a generic messaging system with no specific message format. Send the URL over RPC.  
[Remote method calls | LiveKit Documentation](https://docs.livekit.io/transport/data/rpc/)

2. **Handle the message in React** : When you receive the RPC message, use your navigation mechanism (e.g., React Router) to navigate to the desired page.

See the drive-thru example which uses RPC to update the frontend with data:

> **[python-agents-examples/complex-agents/drive-thru at main ·...](https://github.com/livekit-examples/python-agents-examples/tree/main/complex-agents/drive-thru)**
>
> Runnable examples for LiveKit Agents in Python. Contribute to livekit-examples/python-agents-examples development by creating an account on GitHub.
