SDK API reference
The sdk.slides namespace is the entry point for all presentation operations. An open Presentation instance exposes sub-namespaces for slides, metadata, notes, presenter controls, versions, publishing, presence, and undo.
The visibility field accepts private, workspace, and public. (unlisted is a retired legacy alias, still accepted on the API and treated as public.)
sdk.slides — top-level
Section titled “sdk.slides — top-level”sdk.slides.create()
Section titled “sdk.slides.create()”Create a presentation. Returns both the editor and published artifact URLs.
create(options: CreateOptions): Promise<CreateResult>
interface CreateOptions { title: string; description?: string; template?: string; // built-in theme name aspectRatio?: '16:9' | '4:3' | '16:10'; visibility?: 'private' | 'workspace' | 'public'; theme?: string; // alias for template slides?: SlideSpec[]; // create with content fromMarkdown?: string; // markdown outline → slides}
interface CreateResult { id: string; editorUrl: string; // shareout.site/a/{slug} publishedUrl: string; // shareout.site/p/{slug} editorArtifactId: string; publishedArtifactId: string;}sdk.slides.open()
Section titled “sdk.slides.open()”Open a presentation for editing. Requires authentication with editor or owner role.
open(id: string): Promise<Presentation>sdk.slides.view()
Section titled “sdk.slides.view()”Open a presentation for viewing. No authentication needed for public presentations.
view(id: string): Promise<Presentation>sdk.slides.list()
Section titled “sdk.slides.list()”List all presentations associated with this artifact.
list(): Promise<PresentationInfo[]>
interface PresentationInfo { id: string; title: string; slideCount: number; editorUrl: string; publishedUrl: string; visibility: 'private' | 'workspace' | 'public'; createdAt: string; updatedAt: string;}sdk.slides.delete()
Section titled “sdk.slides.delete()”delete(id: string): Promise<boolean>sdk.slides.generate()
Section titled “sdk.slides.generate()”Generate a full deck from a prompt using server-side AI. Returns the same shape as create().
generate(options: { prompt: string; theme?: string; length?: number; // target slide count title?: string; visibility?: 'private' | 'workspace' | 'public';}): Promise<CreateResult>Returns 503 when no AI provider is configured; 502 on invalid model output.
sdk.slides.helpers
Section titled “sdk.slides.helpers”HTML generation utilities. See Authoring decks for usage.
helpers.textBlock(content: string, style?: TextStyle): stringhelpers.image(blobId: string, options?: ImageOptions): stringhelpers.codeBlock(code: string, language: string): stringhelpers.chart(config: ChartConfig): stringhelpers.embed(url: string, options?: EmbedOptions): stringhelpers.video(blobId: string, options?: VideoOptions): stringhelpers.fromMarkdown(md: string): SlideSpec[]
// Full-slide layoutshelpers.layout.title(slots): stringhelpers.layout.section(slots): stringhelpers.layout.titleContent(slots): stringhelpers.layout.twoCol(slots): stringhelpers.layout.imageText(slots): stringhelpers.layout.fullImage(slots): stringhelpers.layout.bigStat(slots): stringhelpers.layout.quote(slots): stringhelpers.layout.cards(slots): stringhelpers.layout.chart(slots): stringhelpers.layout.blank(html: string): stringPresentation — connection
Section titled “Presentation — connection”connect(): Promise<void> // connect to realtime documentdisconnect(): void // disconnect (keeps document)destroy(): void // disconnect and release resourcestransact(fn: () => void): void // batch changes into one undo steppresentation.meta
Section titled “presentation.meta”Presentation-level metadata. Properties set here cascade to all slides unless a slide specifies an override.
meta.get(): PresentationMetameta.set(changes: Partial<PresentationMeta>): voidmeta.observe(handler: (meta: PresentationMeta) => void): () => void
interface PresentationMeta { title: string; description: string; dimensions: { width: number; height: number }; aspectRatio: '16:9' | '4:3' | '16:10'; template: string | null; defaultFont: { heading: string; body: string; mono: string }; defaultColors: { background: string; text: string; accent: string }; defaultTransition: TransitionConfig; createdBy: string; updatedAt: string;}presentation.slides
Section titled “presentation.slides”Slide CRUD. Content is stored separately from metadata.
slides.list(): Slide[]slides.add(options?: AddSlideOptions): Slideslides.delete(slideId: string): booleanslides.move(fromIndex: number, toIndex: number): voidslides.duplicate(slideId: string): Slideslides.observe(handler: (slides: Slide[]) => void): () => void
interface Slide { id: string; owner: string | null; overrides: SlideOverrides | null; hidden: boolean; locked: boolean;}
interface SlideOverrides { background?: string; font?: { heading?: string; body?: string; mono?: string }; transition?: TransitionConfig;}
interface AddSlideOptions { afterSlideId?: string; content?: string;}Content
Section titled “Content”// Get Y.Text for collaborative binding (e.g. contenteditable, CodeMirror)slides.getContent(slideId: string): Y.Text
// Set content directlyslides.setContent(slideId: string, html: string): void
// Update metadata (overrides, hidden, locked)slides.update(slideId: string, changes: Partial<Slide>): voidBulk operations
Section titled “Bulk operations”slides.addMany(slides: SlideSpec[]): Promise<Slide[]>slides.replaceAll(slides: SlideSpec[]): Promise<Slide[]>Both call POST /data/slides/{id}/slides/batch — atomic server-side write.
Ownership and locking
Section titled “Ownership and locking”slides.setOwner(slideId: string, userId: string | null): voidslides.getOwner(slideId: string): string | nullslides.lock(slideId: string): voidslides.unlock(slideId: string): voidslides.isLocked(slideId: string): booleanPer-slide AI
Section titled “Per-slide AI”slides.rewrite(slideId: string, instruction: string): Promise<void>slides.expand(slideId: string, instruction: string): Promise<void>slides.generateNotes(slideId: string): Promise<string>slides.suggestLayout(slideId: string): Promise<string>presentation.speakerNotes
Section titled “presentation.speakerNotes”Per-slide Markdown notes stored as Y.Text.
speakerNotes.get(slideId: string): Y.Text // Y.Text for collaborative bindingspeakerNotes.set(slideId: string, content: string): voidpresentation.presenter
Section titled “presentation.presenter”See Presenter mode for full usage.
presenter.start(options?: StartOptions): Promise<void>presenter.stop(): voidpresenter.state(): PresentationStatepresenter.isActive(): booleanpresenter.isPresenter(): booleanpresenter.subscribe(handler: (state: PresentationState) => void): () => void
// Navigationpresenter.next(): voidpresenter.previous(): voidpresenter.goToSlide(index: number): voidpresenter.first(): voidpresenter.last(): void
// Blackoutpresenter.blackout(enabled: boolean): void
interface StartOptions { fromSlide?: number; countdown?: number; // seconds autoAdvance?: boolean; autoAdvanceInterval?: number;}
interface PresentationState { isPresenting: boolean; presenterId: string | null; presenterName: string | null; currentSlideIndex: number; totalSlides: number; startedAt: number | null; slideStartedAt: number | null; countdown: { total: number; remaining: number; paused: boolean } | null; laser: { enabled: boolean; position: { x: number; y: number } | null }; blackout: boolean;}presenter.timer
Section titled “presenter.timer”timer.elapsed(): number // seconds since presentation startedtimer.slideElapsed(): number // seconds on current slidetimer.setCountdown(seconds: number): voidtimer.remaining(): number | null // null if no countdown settimer.pause(): voidtimer.resume(): voidtimer.reset(): voidpresenter.laser
Section titled “presenter.laser”laser.enable(): voidlaser.disable(): voidlaser.move(x: number, y: number): void // normalized 0–1laser.isEnabled(): booleanpresentation.versions
Section titled “presentation.versions”versions.list(): Promise<Version[]>versions.create(name: string, description?: string): Promise<Version>versions.restore(versionId: string): Promise<void>versions.diff(fromId: string, toId: string): Promise<VersionDiff>versions.delete(versionId: string): Promise<boolean>versions.subscribe(handler: (versions: Version[]) => void): () => void
interface Version { id: string; presentationId: string; name: string; description: string | null; slideCount: number; createdAt: string; createdBy: { id: string; name: string; email: string }; isAutoSave: boolean; thumbnail: string | null;}
interface VersionDiff { slides: { added: string[]; removed: string[]; modified: string[]; reordered: boolean }; metadata: { changed: string[] };}presentation.publish
Section titled “presentation.publish”publish.getUrl(): string // shareout.site/p/{slug}publish.setVisibility(v: 'private' | 'workspace' | 'public'): voidpublish.unpublish(): voidpublish.republish(): voidpresentation.presence
Section titled “presentation.presence”Ephemeral user state — not stored in the Y.js document.
presence.set(state: Partial<SlidesPresenceState>): voidpresence.get(): Map<string, SlidesPresenceState>presence.subscribe(handler: (users: Map<string, SlidesPresenceState>) => void): () => voidpresence.getEditorsOnSlide(slideId: string): SlidesPresenceState[]
interface SlidesPresenceState { user: { id: string; name: string; color: string }; viewingSlideId: string | null; editingSlideId: string | null; cursor: { x: number; y: number } | null; textSelection: { start: number; end: number } | null; laserPointer: { x: number; y: number } | null; mode: 'edit' | 'view' | 'present' | 'speaker';}presentation.undo
Section titled “presentation.undo”Per-user undo stack scoped to the current client’s changes.
undo.manager(): Y.UndoManagerundo.canUndo(): booleanundo.canRedo(): booleanundo.undo(): voidundo.redo(): voidEvents
Section titled “Events”presentation.on(event: SlidesEvent, handler: Function): voidpresentation.off(event: SlidesEvent, handler: Function): void
type SlidesEvent = | 'slide:added' | 'slide:deleted' | 'slide:reordered' | 'slide:updated' | 'presentation:start' | 'presentation:end' | 'slide:change' // current slide changed during presentation | 'sync' | 'status'; // connection statusExport
Section titled “Export”presentation.export(format: 'pdf' | 'png', slideId?: string): Promise<Blob>presentation.exportUrl(format: 'pdf' | 'png', slideId?: string): stringReturns 503 when the BROWSER binding is unavailable.
TypeScript types
Section titled “TypeScript types”interface TransitionConfig { type: 'none' | 'fade' | 'slide' | 'convex' | 'concave' | 'zoom'; speed: 'fast' | 'default' | 'slow'; direction?: 'left' | 'right' | 'up' | 'down';}
interface TextStyle { fontSize?: number; fontFamily?: string; fontWeight?: 'normal' | 'bold'; color?: string; textAlign?: 'left' | 'center' | 'right';}
interface ImageOptions { width?: string; height?: string; align?: 'left' | 'center' | 'right'; caption?: string; alt?: string;}
interface EmbedOptions { width?: string; height?: string; allowFullscreen?: boolean;}
type SlideSpec = | { layout: string; [slot: string]: unknown; notes?: string; hidden?: boolean } | { html: string; notes?: string; hidden?: boolean }