@constructor-io/constructorio-ui-pia

中文文档
2.22.1发布于 2026/11/06MITTypeScriptESM + CJS构建来源已验证近 30 天下载 9404

Constructor.io AI Product Insights Agent UI library for web applications

原始使用文档
文档目录10 节
  1. Install
  2. Usage
  3. Local Development
  4. Development Scripts
  5. Library Maintenance
  6. Publishing New Versions
  7. New Storybook Version
  8. Related Libraries
  9. Contributing
  10. License

Constructor.io AI Product Insights Agent UI Library

npm MIT licensed

React components for Constructor.io's AI Product Insights Agent: an AI Q&A widget for product pages.

Documentation →

Install

npm i @constructor-io/constructorio-ui-pia

Usage

import { CioPia } from '@constructor-io/constructorio-ui-pia';
import '@constructor-io/constructorio-ui-pia/styles.css';

<CioPia apiKey='YOUR_API_KEY' itemId='PRODUCT_ITEM_ID' itemName='Product name' />;

Display modes, callbacks, customization, and every prop are in the docs.

Local Development

Development Scripts

npm ci                  # Install dependencies for local dev
npm run dev             # Start a local dev server for Storybook
npm run lint            # Run lint
npm run test            # Run tests
npm run check-types     # Run TypeScript type checking

Library Maintenance

npm run compile           # Generate lib folder for publishing to npm
npm run build-storybook   # Generate Storybook static bundle for deploy with GitHub Pages

Publishing New Versions

Dispatch the Publish workflow in GitHub Actions. You're required to provide two arguments:

  • Version Strategy: major, minor, or patch.
  • Title: A title for the release.

This workflow will automatically:

  1. Bump the library version using the provided strategy.
  2. Create a new git tag.
  3. Create a new GitHub release.
  4. Compile the library.
  5. Publish the new version to NPM.
  6. Deploy the Storybook docs to GitHub Pages.

Note: Please don't manually increase the package.json version or create new git tags.

The library version is tracked by releases and git tags. We intentionally keep the package.json version at 0.0.0 to avoid pushing changes to the main branch. This solves many security concerns by avoiding the need for branch-protection rule exceptions.

New Storybook Version

Dispatch the Deploy Storybook workflow in GitHub Actions.

Note: This is already done automatically when publishing a new version.

Contributing

  1. Fork the repo and create a new branch.
  2. Run npm ci to install dependencies.
  3. Make your changes.
  4. Run npm run lint and npm run test to verify. For docs changes, follow .claude/docs.md.
  5. Submit a PR for review.

License

MIT © Constructor.io Corporation

版本与发布记录

@constructor-io/constructorio-ui-pia 共发布 45 个版本,首次发布于 2025/07/22;过去 12 个月发布了 44 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.22.1latest2026/11/064 天前
2.22.02026/11/047 天前
2.21.02026/11/028 天前
2.20.22026/10/2814 天前
2.20.12026/10/2219 天前
2.20.02026/10/2120 天前

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

@constructor-io/constructorio-ui-pia 是什么?

Constructor.io AI Product Insights Agent UI library for web applications

如何安装 @constructor-io/constructorio-ui-pia?

在项目目录运行 npm install @constructor-io/constructorio-ui-pia,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.12.0)、tslib(^2.4.0)、react-dom(>=16.12.0)、@constructor-io/constructorio-ui-components(^1.5.0)、@constructor-io/constructorio-client-javascript(^2.93.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@constructor-io/constructorio-ui-pia 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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