DailyProvider

<DailyProvider callObject={callObject}>

The DailyProvider gives every component in your application access to the Daily call object. It stores call state and initiates a call object instance.

This component allows for two modes: It can take either an existing call object or props to instantiate its own callObject instance.

We recommend utilizing useCallObject to create your own call object instance.

Props

In existing call object mode:

ParameterRequiredTypeDescription
callObjectObjectPre-initialized call object instance (instantiated via createCallObject())

In call object creation mode:

ParameterRequiredType
urlstring
audioSourcestring | MediaStreamTrack | boolean
videoSourcestring | MediaStreamTrack | boolean
dailyConfigObject
receiveSettingsObject
subscribeToTracksAutomaticallyboolean
tokenstring
userNamestring

For full details on all the properties above, see the properties list.

Changing any of the props in call object creation mode will destroy the current instance and create a new one with the updated props.

Optional props

ParameterTypeDescription
recoilRootPropsObjectRecoilRootProps to be passed to Daily React's internal <RecoilRoot>. More details in Recoil Docs

Sample code

Store Daily React's state in your own RecoilRoot