Controlling client UI / browser navigation with chatbot (React.js)

I’m trying to allow users to trigger UI changes using chatbot commands and I’m struggling to figure it out.

Example: User types, “can I log in please” causing the browser to navigate to /login or call a client side function called OpenLoginModal()

I think using the best way is “function calling” parameter to handle the response on the server and then check on the client if the response is a function call and trigger a response.

Has anyone done something similar to this? Would this work with text streaming?

Many thanks