daily-js instance that joins rooms, sends media, and emits events. DailyProvider holds it and shares it with your component tree. In most apps, the provider creates and manages the call object for you.
Let DailyProvider create the call object
The simplest and recommended setup is to pass your roomurl (and any other factory options such as token or userName) directly to DailyProvider. The provider creates the call object, manages its lifecycle, and tears it down for you.
Create the call object yourself
Create the instance yourself only when you need direct control over it, for example to access it before the provider mounts, share it outside the provider tree, or create it conditionally. UseuseCallObject, then pass it to the provider with the callObject prop:
shouldCreateInstance:
Access it anywhere with useDaily
Inside the provider,useDaily returns the same DailyCall instance. Use it for imperative actions that do not have a dedicated hook:
daily is null until the call object exists, so guard with optional chaining or an early return.
The call lifecycle
A custom call moves through the same lifecycle as anydaily-js call. useMeetingState gives you the current stage reactively:
Joining and leaving
There is nouseJoin hook: joining is an imperative action, so call join() on the object from useDaily. A mount effect with a cleanup that calls leave() is the idiomatic pattern:
url (and token) on DailyProvider as recommended above, the call object already has them, so you can call daily.join() with no arguments. Pass them to join() explicitly only when they are not already on the provider.
The instance is reusable: after leave(), the meeting state becomes left-meeting and you can join() again.
Handling errors
useDailyError exposes the most recent fatal and nonfatal errors as state:
Embedding Prebuilt instead of a custom UI
If you want Daily’s ready-made UI, create a Prebuilt iframe withuseCallFrame and pass it to the same provider:
An iframe runs in a separate secure context, so track-level data is not available across the boundary. Hooks that read meeting and participant state still work, but media hooks like
useMediaTrack will not return tracks. For full control over media, use a call object instead.Next steps
Working with participants
Read and react to participant state.
Rendering media
Show video and play audio.