Dollie Editor SDK guide

TransportClient

Reference for page persistence adapters.

Required methods:

interface TransportClient {
  load(pageId: string): Promise<BuilderDocument>;
  save(
    pageId: string,
    input: {
      definition: PageConfig;
      revision?: string;
      label?: string;
      trail?: PageRevisionTrailEntry[];
    },
  ): Promise<BuilderDocument>;
  publish(pageId: string): Promise<BuilderDocument>;
  validate(definition: PageConfig): Promise<ValidationResult>;
}

Optional methods add:

  • binding source listing and resolution;
  • template listing and retrieval;
  • revision listing and restore;
  • AI-fill start, status, and apply.

Feature-detect optional methods or pair them with resolved document capabilities.

Template methods

Template libraries can expose a lightweight index and fetch full JSON on demand:

listTemplates?(): Promise<TemplateSummary[]>;
getTemplate?(templateId: string): Promise<PageTemplate>;

TemplateSummary contains id, name, optional description and vertical metadata, and an optional catalogId. After getTemplate, run the result through parsePageTemplate and importTemplate before applying it.

The transport contract deliberately does not prescribe saveTemplate or deleteTemplate. The host owns creation, sharing, tenancy, authorization, and retention. Use exportTemplate to create the JSON and persist it through a host endpoint when Editor users can save their own templates.

When you keep revision history, store label and trail on the revision created by the save. Return the trail from listRevisions so the Editor can rebuild its timeline after a reload.