Requirements
daily-js runs in any browser that supports WebRTC. See here for a full list of supported browsers and versions.Package manager
Install the@daily-co/daily-js package using your preferred package manager:
Importing the library
The package’s default export is declared as
Daily in the TypeScript types, while, for historical reasons, the underlying class is named DailyIframe. In our documentation and examples, we refer to the default export as Daily for clarity, but you may see DailyIframe in some contexts, especially in older code snippets. Both refer to the same default export.- ESM
- CommonJS
- CDN (script tag)
Use a default import. The exported default is the You can also import named exports for constants and types:
Daily class, which acts as both a factory and a namespace for static utilities.TypeScript
@daily-co/daily-js ships with TypeScript definitions in index.d.ts. No additional @types package is needed.
While
Daily is the default export and namespace, DailyCall is the interface describing an active call instance returned by the factory methods (createFrame, createCallObject, wrap).Named exports
In addition to the default export (theDailyIframe class), the package exports a set of named constants you can use for comparisons:
DailyMeetingState, DailyFatalErrorType, and DailyCameraErrorType types. Using constants instead of raw strings helps avoid typos: