Sharing schema — UI Protocol reference
Sharing & Embedding Protocol — Public-link sharing of a form view. Reference for SharingConfig: every property with its type and default.
Sharing & Embedding Protocol
Public-link sharing of a form view. The module name is plural for historical
reasons: it once held two shapes in opposite postures, and #4001 批 14
measured them per SCHEMA rather than assuming a file-level verdict —
SharingConfigSchema a live authoring door, EmbedConfigSchema no door at
all. That measurement is what let the two be disposed of separately, and the
asymmetry survives as the reason this file reads the way it does:
SharingConfigSchemahas a live authoring door.FormViewSchema.sharingcarries it (view.zod.ts),viewis a metadata-type root, and the runtime really reads it:rest-server.tsserves the anonymous form endpoints only whensharing.enabled === true,sharing.allowAnonymous === trueand asharing.publicLinkslug matches (anonymousFormIntakeCandidatesinanonymous-form-intake.tsbeside this module, which@objectstack/metadata-corere-exports to the server's doors). Both example apps author it (app-showcaseinquiry.view.ts,app-crmlead.view.ts). It isstrictObjectas of #4001 批 14.EmbedConfigSchemawas REMOVED at the no-door retirement (ADR-0049 enforce-or-remove) — see the block below where it stood.
The ledger's classification question is "who writes this schema's input?", and it is answered per SCHEMA, not per file; before 批 14 this file's row carried one verdict for both, and a file-level verdict would have been wrong in one direction or the other whichever way it fell.
Source: packages/spec/src/ui/sharing.zod.ts
TypeScript Usage
import { SharingConfigSchema } from '@objectstack/spec/ui';
import type { SharingConfig } from '@objectstack/spec/ui';
// Validate data
const result = SharingConfigSchema.parse(data);SharingConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | optional (default: false) | Enable public sharing |
| publicLink | string | optional | Public slug of the form, chosen by the author: not a URL, and never generated. /forms/x, forms/x and x name one slug, x. It is served to anonymous visitors only while enabled and allowAnonymous are both true: the REST form door answers GET /api/v1/forms/:slug (default API base), and a host that serves the console shows the form at /_console/f/:slug and redirects /forms/:slug there, query string carried. |
| password | string | optional | Password required to access shared link |
| allowedDomains | string[] | optional | Restrict access to specific email domains (e.g. ["example.com"]) |
| expiresAt | string | optional | Expiration date/time in ISO 8601 format |
| allowAnonymous | boolean | optional (default: false) | Allow access without authentication |