@daily-co/daily-js

中文文档
0.95.0发布于 2026/11/07BSD-2-ClauseTypeScriptESM + CJS近 30 天下载 489.6万

Please check our our documentation site to get started. If you're building a web app with our daily-js front-end JavaScript library, you may be particularly interested in:

原始使用文档

🎥 Get started with Daily

Please check our our documentation site to get started. If you're building a web app with our daily-js front-end JavaScript library, you may be particularly interested in:

⚠ Upcoming changes that may require action

strictMode: false will no longer allow multiple call instances

Today, you can circumvent throwing an Error on creation of a second (or nth) Daily instance by setting strictMode: false in the constructor parameters. With the introduction of proper support for multiple instances, this is replaced with the opt-in parameter, allowMultipleCallInstances. So in a future release, if your application needs to use multiple call instances simultaneously, you must set this new parameter to true, otherwise multiple instances will not be allowed and an Error will be thrown (regardless of strictMode).

While we will technically support multiple instances and the fear of bugs when doing so goes away, the majority of use cases only requires one instance and having multiple is likely accidental and will still cause issues. It's for this reason we default to throwing an Error in the hopes of avoiding footguns.

Note: strictMode, which defaults to true, will continue to be used for disallowing use of a Daily call instance after it has been destroyed.

avoidEval will become true by default

Today you can opt in to making daily-js behave in a CSP-friendly way by specifying dailyConfig: { avoidEval: true } wherever you provide your call options. You can read more about this option and how to set up your CSP (Content Security Policy) in this guide.

Starting in an upcoming version of daily-js, avoidEval will switch to defaulting to true. To prepare for this change, please make sure that your CSP's script-src directive contains https://*.daily.co (or explicitly opt out of the new behavior by setting avoidEval: false).

版本与发布记录

@daily-co/daily-js 共发布 178 个版本,首次发布于 2019/05/17;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.95.0latest2026/11/073 天前
0.94.02026/10/1725 天前
0.93.02026/10/031 个月前
0.92.22026/08/202 个月前
0.92.02026/08/152 个月前
0.91.02026/06/115 个月前

其他发布通道:beta → 0.16.0-beta.0,alpha → 0.29.0-alpha.1,experimental → 0.82.0-experimental.1。

关于 @daily-co/daily-js 的常见问题

@daily-co/daily-js 是什么?

Please check our our documentation site to get started. If you're building a web app with our daily-js front-end JavaScript library, you may be particularly interested in:

如何安装 @daily-co/daily-js?

在项目目录运行 npm install @daily-co/daily-js,或使用 pnpm add / yarn add / bun add。

@daily-co/daily-js 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@daily-co/daily-js 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@daily-co/daily-js 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.14.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@daily-co/daily-js 可以商用吗?

@daily-co/daily-js 使用 BSD-2-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@daily-co/daily-js 的下载量有多少?

根据 npm 官方下载统计,@daily-co/daily-js 在 2026/10/11 – 2026/11/09 这 30 天内被下载 4,895,944 次,日均约 163,198 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@daily-co/daily-js 还在维护吗?

最新版本 0.95.0 发布于 2026/11/07(3 天前);至今共发布 178 个版本,其中过去 12 个月发布了 11 个;首次发布于 2019/05/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。