How to transcribe all participants in a room, not just the first one

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

I’m having trouble getting an agent implementation that transcribes all participants in a room.

Right now, my code only runs for the first participant that joins, and the agent leaves when that user leaves. How can I make it transcribe any participant that joins?

For transcribing all participants, check out the multi-user transcriber example:

If you want one agent per participant instead, make sure to set the JT_PARTICIPANT flag in your WorkerOptions. This causes an agent to be dispatched for each participant rather than just once for the room.