@cossistant/browser
v0.2.0
Published
Browser runtime and CDN embed for the Cossistant support widget.
Maintainers
Readme
Cossistant Browser Runtime
@cossistant/browser is the browser embed layer for the Cossistant support
widget.
It stays intentionally thin:
@cossistant/coreowns the runtime controller@cossistant/reactremains the single widget authoring surface- the embed bundle aliases React to Preact compat for smaller CDN assets
That means browser stays in lockstep with React by construction. When the React widget changes, the browser widget updates on the next browser build and release.
Package surfaces
- Library/runtime entry:
mountSupportWidget()
- CDN embed build:
loader.jswidget.jswidget.css
Browser embed characteristics
- mounts into a
ShadowRootby default - injects
widget.cssinto the shadow tree only - preserves
--co-*and--co-theme-*custom-property theming - exposes
window.Cossistant.init(),show(),hide(),toggle(),identify(),updateConfig(),destroy(),on(), andoff()
CDN usage
Load the latest widget from the CDN with:
<script async src="https://cdn.cossistant.com/widget/latest/loader.js"></script>
<script>
window.Cossistant.init({
publicKey: "pk_live_..."
});
</script>The loader derives widget.js and widget.css from its own URL, so the
versioned form works the same way:
<script async src="https://cdn.cossistant.com/widget/0.1.2/loader.js"></script>Release model
@cossistant/browseris in the same Changesets fixed-version group as@cossistant/coreand@cossistant/react- GitHub Actions builds and uploads versioned embed assets to S3 + CloudFront
- the release workflow reuses the shared infra variables already used by app
uploads:
S3_REGIONS3_BUCKET_NAMES3_CDN_BASE_URLAWS_ROLE_ARNCLOUDFRONT_DISTRIBUTION_ID
- immutable versioned assets and a
latest/alias are both published
