@dolard.eu/versiq-core-types
v0.2.0
Published
Cross-workspace TypeScript contracts and Zod schemas consumed by @dolard.eu/versiq-widget. Intended as a peer of the widget SDK.
Maintainers
Readme
@dolard.eu/versiq-core-types
Cross-workspace TypeScript contracts and Zod schemas consumed by
@dolard.eu/versiq-widget.
Companion package — not for standalone use. This package exists to share type definitions between the Versiq backend, the marketing site, and the public widget SDK. If you are integrating the widget into your site, you need
@dolard.eu/versiq-widget, not this one. The widget already re-exports the types you need.
When you might need this directly
You only need to depend on @dolard.eu/versiq-core-types if you are building a
custom integration that talks to the Versiq backend without going through the
widget SDK — for example, a server-to-server pipeline that posts events to the
Versiq API and wants the same Zod schemas the official widget uses.
Installation
npm install @dolard.eu/versiq-core-types zod
# or
pnpm add @dolard.eu/versiq-core-types zodzod is a peer dependency: schemas are runtime-validatable.
Scope (ADR-006)
The package contract is intentionally narrow: only types and schemas that cross a workspace boundary live here. Domain-specific schemas (real-estate profiles, B2B qualification, scoring rules, …) stay in the workspace that owns the domain.
Public exports
| Module | Contents |
| ----------------------- | ------------------------------------------------------------------------ |
| theme | ThemeConfig, hex-color constraints, default palette |
| theme-resolver | Merges host-side theme with server-side theme; returns the final config |
| viewport | Viewport bucket helpers (mobile / tablet / desktop) + breakpoints |
| widget-config | WidgetConfig — the public contract of createWidget(config) |
| widget-runtime-config | Internal runtime view of the resolved widget config (after server merge) |
| application-config | Server-side Application metadata (vertical, allowed origins, identity) |
| postmessage | Discriminated unions for window.postMessage host ↔ iframe protocol |
| geo | Lightweight geo primitives (LatLng, BoundingBox) |
import type {
ThemeConfig,
WidgetConfig,
ViewportBucket,
HostToWidgetMessage,
WidgetToHostMessage,
} from "@dolard.eu/versiq-core-types";
import {
themeConfigSchema,
hostToWidgetMessageSchema,
} from "@dolard.eu/versiq-core-types";All schemas are Zod 4 (zod@^4.2.0) and infer their TypeScript types via
z.infer<typeof xxxSchema> — the same .parse() / .safeParse() API as the
widget itself.
Versioning
Released in lockstep with @dolard.eu/versiq-widget (same version number).
Breaking changes follow SemVer:
- MINOR — added optional fields, added discriminant values, new schemas
- MAJOR — removed/renamed fields, narrowed unions, schema-level breaking changes
The widget SDK pins its dependency on @dolard.eu/versiq-core-types to the
exact same version it ships with — you never need to align them yourself.
License
Commercial Source-available — see LICENSE.
This is not an open-source release. The source is published so integrators can audit what runs in their visitors' browsers, but fork / redistribution / competing-SDK use are prohibited without a written agreement.
For commercial licensing inquiries: [email protected]
