@constructor-io/constructorio-node

中文文档
5.11.0发布于 2026/11/06MITTypeScriptCommonJS近 30 天下载 7.7万

Constructor.io Node.js client

原始使用文档
文档目录7 节
  1. Documentation
  2. 1. Review the Requirements
  3. 2. Install
  4. 3. Retrieve an API key and token
  5. 4. Implement the Client
  6. 5. Retrieve Results
  7. Development / npm commands

Constructor.io Node Client

npm MIT licensed

A Node.js client for Constructor.io. Constructor.io provides search as a service that optimizes results using artificial intelligence (including natural language processing, re-ranking to optimize for conversions, and user personalization).

This client is intended for use in server side integrations. If you want a JavaScript client for client side (i.e. front end) integrations please use @constructor-io/constructorio-client-javascript

Documentation

Full API documentation is available on Github Pages

Updating from v3 to v4? Be sure to read the upgrade guide for an explanation of changes made to the Catalog module

1. Review the Requirements

Requesting results from your Node.js back-end can be useful in order to control result rendering logic on your server, or augment/hydrate results with data from another system. However, a back-end integration has additional requirements compared to a front-end integration. Please review the Additional Information For Backend Integrations article within the wiki for more detail.

2. Install

This package can be installed via npm: npm i @constructor-io/constructorio-node. Once installed, simply import or require the package into your repository.

Important: this library should only be used in a server-side context.

3. Retrieve an API key and token

You can find this in your Constructor.io dashboard. Contact sales if you'd like to sign up, or support if you believe your company already has an account.

4. Implement the Client

Once imported, an instance of the client can be created as follows:

const ConstructorIOClient = require('@constructor-io/constructorio-node');

var constructorio = new ConstructorIOClient({
    apiKey: 'YOUR API KEY',
});

5. Retrieve Results

After instantiating an instance of the client, four modules will be exposed as properties to help retrieve data from Constructor.io: search, browse, autocomplete, recommendations, catalog and tracker.

Development / npm commands

npm run lint          # run lint on source code and tests
npm run test          # run tests
npm run coverage      # run tests and serves coverage reports from localhost:8081
npm run docs          # output documentation to `./docs` directory

版本与发布记录

@constructor-io/constructorio-node 共发布 122 个版本,首次发布于 2021/02/05;过去 12 个月发布了 12 个版本。

版本发布日期距今
5.11.0latest2026/11/064 天前
5.10.32026/10/2219 天前
5.10.22026/08/252 个月前
5.10.12026/08/192 个月前
5.10.02026/06/264 个月前
5.9.02026/06/095 个月前

其他发布通道:beta → 4.14.5-beta.0。

关于 @constructor-io/constructorio-node 的常见问题

@constructor-io/constructorio-node 是什么?

Constructor.io Node.js client

如何安装 @constructor-io/constructorio-node?

在项目目录运行 npm install @constructor-io/constructorio-node,或使用 pnpm add / yarn add / bun add。

@constructor-io/constructorio-node 支持 TypeScript 吗?

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

@constructor-io/constructorio-node 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@constructor-io/constructorio-node 需要什么版本的 Node.js?

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

@constructor-io/constructorio-node 可以商用吗?

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

@constructor-io/constructorio-node 的下载量有多少?

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

@constructor-io/constructorio-node 还在维护吗?

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