@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