Monorepo for @zooza/* npm packages — embeddable Zooza widgets wrapped for every major JS framework.
ZWM (for spec_id generation — ZOO is taken by zooza-api).
@zooza/widgets-core owns 100% of DOM/loader logic. Framework packages (wc, react, vue, svelte) are thin lifecycle adapters — they never touch the embed mechanism directly. Any change to the embed contract goes into core only.
The embed contract mirrors the official snippet from api.zooza.app:
data-zooza-api-urlattribute on<body>— page-global, one API base per page- embedder
<script>whoseidIS the company API key (public, per-company, required);data-version,data-widget-idattributes (data-widget-idis the constant"zooza") - async widget script
{apiUrl}/widgets/{version}/?type={type}&ref={ref}inserted before embedder — the key is never in the URL; the remote script reads it from the embedder'sidin the DOM
Widget type → version map lives in packages/core/src/index.ts (WIDGET_VERSIONS).
API regions: https://api.zooza.app (default), https://{region}.api.zooza.app (uk, asia, open-ended for future). regionApiUrl() in core; explicit apiUrl beats region.
Config precedence everywhere: per-widget option/prop/attribute → initZooza() global config → default.
pnpm install --filter "@zooza/*" # install package deps only (examples are heavy)
pnpm build # build all @zooza/* packages (tsup)
pnpm changeset # start a release note
pnpm release # build + publish (owner only)packages/{core,wc,react,vue,svelte}— published packages, each:src/index.ts,tsup.config.ts,README.mdexamples/{vanilla-html,react-vite,nextjs,vue-vite,svelte-vite}— runnable demos, workspace members, never publishedassets/— logo source; the inline SVG used at runtime lives inpackages/core/src/logo.tsspecs/,handoffs/— SDD lifecycle folders (see global CLAUDE.md)
- Framework deps are
peerDependencies, never bundled;@zooza/widgets-coreis a regular dependency (workspace:^) - All packages ship ESM + CJS + d.ts via tsup;
exportsmaps with per-condition types refoption is renamedrefUrlin React/Vue (reserved prop) — keep names consistent otherwise- Versions are changeset-linked across all
@zooza/*packages - The remote widget script renders the UI — packages must never reimplement widget UI
Widget script endpoint (/widgets/v1/, /widgets/v2/) is owned by zooza-api. Changes to the embed contract (e.g. a stable mount API) require a handoff to zooza-api.