@starcier/collab-core

中文文档
1.0.0发布于 2026/11/02MITTypeScriptES Module

Headless half of the Starcier collaboration layer: comment and workflow stores, the API client and its types.

原始使用文档
文档目录3 节
  1. Install
  2. Use
  3. License

@starcier/collab-core

The headless half of the Starcier collaboration layer: the comment and workflow stores, the API client and their types. Nothing here renders anything or knows a design system.

Most builders do not use this package directly. @starcier/builder-shell mounts it for you, and @starcier/collab-ui draws the comments and tours on top of it. Reach for it yourself only when your app keeps its own shell.

Install

npm install @starcier/collab-core@next

Until 1.0.0 is released, versions are prereleases (1.0.0-next.N): always install with @next. Without it, npm installs the first prerelease, not the newest. Requires React 18 or 19.

Use

Wrap the part of your app that uses comments or workflows:

import { CollabProvider } from '@starcier/collab-core';

<CollabProvider
  apiBaseUrl={API_BASE_URL}       // the API origin, without /v1
  getToken={getAccessToken}       // null while nobody is signed in
  tenant={TENANT_SLUG}            // your builder's tenant slug
>
  {children}
</CollabProvider>

Leave apiBaseUrl unset and everything runs against localStorage, with no backend. Keep tenant set even then: it keeps this builder's local data apart from other builders on the same origin. Workflows passed as workflowSeeds are copied into each browser once; later edits to a seed in code reach a browser only under a new id.

On start, the provider asks the API whether this version is still supported. If it is too old, comments and tours switch off with a message naming the version you need and the upgrade command; the rest of your app keeps working.

License

MIT

版本与发布记录

@starcier/collab-core 共发布 7 个版本,首次发布于 2026/10/23;过去 12 个月发布了 7 个版本。

版本发布日期距今
1.0.0latest2026/11/021 天前
1.0.0-next.4next2026/10/294 天前
1.0.0-next.32026/10/277 天前
1.0.0-next.22026/10/2310 天前
1.0.0-next.12026/10/2311 天前
1.0.0-next.02026/10/2311 天前

关于 @starcier/collab-core 的常见问题

@starcier/collab-core 是什么?

Starcier协作层的一半:注释和工作流存储,API客户端及其类型。

如何安装 @starcier/collab-core?

在项目目录运行 npm install @starcier/collab-core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@starcier/collab-core 支持 TypeScript 吗?

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

@starcier/collab-core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@starcier/collab-core 可以商用吗?

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

@starcier/collab-core 还在维护吗?

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