Skip to main content

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:
The @daily-co/daily-js package is small by design — the call bundle is fetched from Daily’s CDN at runtime when you join. See How it works for details.

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.
Use a default import. The exported default is the Daily class, which acts as both a factory and a namespace for static utilities.
You can also import named exports for constants and types:

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 (the DailyIframe class), the package exports a set of named constants you can use for comparisons:
These constants match the string literal values used in the DailyMeetingState, DailyFatalErrorType, and DailyCameraErrorType types. Using constants instead of raw strings helps avoid typos:

Verifying the installation

After installing, run the following snippet in your browser console or application to confirm that daily-js loaded correctly: