@coveo/headless

中文文档
3.58.1发布于 2026/11/03Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 38.3万

A headless library for building search experiences on the Coveo platform

原始使用文档
文档目录6 节
  1. title: Contributing group: Contributing
  2. Entry points
  3. Contributing
  4. Getting started
  5. Redux
  6. Source folder structure

title: Contributing group: Contributing

npm version

Coveo Headless

Using the library: Coveo Headless Library Official Documentation.

Entry points

The @coveo/headless package exposes several entry points.

The entry point from which you will import Coveo Headless resources depends on the engine type you are using:

Engine typeEntry point
Search engine@coveo/headless
Search SSR engine@coveo/headless/ssr
Search SSR engine (in open alpha)@coveo/headless/ssr-next
CaseAssist engine@coveo/headless/case-assist
Commerce engine@coveo/headless/commerce
Commerce SSR engine (in open beta)@coveo/headless/ssr-commerce
Commerce SSR engine (in open alpha)@coveo/headless/ssr-commerce-next
Insight engine@coveo/headless/insight
Recommendation engine@coveo/headless/recommendation

Contributing

Getting started

Once you have cloned the repo, follow the instructions in the top-level README.md to install dependencies and link packages.

To start the project in development mode, run:

pnpm run dev

To build the library for production, run:

pnpm run build

To run the unit tests, run:

pnpm test

To run the unit tests and watch, run:

pnpm run test:watch

To use @coveo/headless locally, you have to build the package by running:

pnpm run build

Redux

The headless project intensively uses "Redux" along with "Redux Toolkit", so prior knowledge is necessary.

Source folder structure

The base of the /src folder should only contain exports.

/ssr contains all logic and types related to server-side rendering (SSR) engines and controllers

/app contains app-wide setup: Redux store, root reducer, middlewares.

/state contains interfaces for the various application states.

/features has folders that each owns the functionalities of a feature, which is a subpart of the redux state. Following the "ducks pattern", those files contain Redux slices & reducers that define the state shape. Each feature folder has a file with actions that can be exported with the project.

/controllers contains all the headless controllers in folders. Those controllers are exported and used to provide abstraction from the store's features by being closer to the actual UI controllers of a customer's application.

/utils contains common useful utilities.

/api contains everything regarding api calls.

/test contains test mocks.

Contribution guide: Adding a new controller.

Please see the contributor guide for guidance.

Contribution guide: Troubleshooting bundle content.

Please see the contributor guide for guidance.

版本与发布记录

@coveo/headless 共发布 4,004 个版本,首次发布于 2020/07/23;过去 12 个月发布了 54 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.58.1latest2026/11/038 天前
3.58.02026/10/2022 天前
3.57.32026/10/1428 天前
3.57.22026/10/061 个月前
3.57.12026/09/301 个月前
3.57.02026/09/231 个月前

其他发布通道:v2-latest → 2.80.7。

关于 @coveo/headless 的常见问题

@coveo/headless 是什么?

A headless library for building search experiences on the Coveo platform

如何安装 @coveo/headless?

在项目目录运行 npm install @coveo/headless,或使用 pnpm add / yarn add / bun add。

@coveo/headless 支持 TypeScript 吗?

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

@coveo/headless 支持 ESM 还是 CommonJS?

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

@coveo/headless 需要什么版本的 Node.js?

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

@coveo/headless 可以商用吗?

@coveo/headless 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@coveo/headless 的下载量有多少?

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

@coveo/headless 还在维护吗?

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