Export API Reference
kittl.export can open the editor's export modal or generate a file directly. Both calls return a SdkResult; check isOk before reading result.
showExportModal(request)
Scope: design:state:read
Opens the host export modal for the requested root object or board IDs. The user chooses export settings and can export or dismiss the modal.
| Property | Type | Required | Description |
|---|---|---|---|
target | string[] | Yes | Root object or board IDs to export, in result order |
title | string | Yes | Modal title |
exportLabel | string | Yes | Export button label |
customFields | PlainInputSetting[] | No | Caller fields shown above export settings; values return by field name in settings |
mimeTypes | ExportMimeType[] | No | Restrict the offered file types, for example ['video/mp4'] |
initialFileFormat | ExportMimeType | No | File type shown first, if an applicable generator offers it |
The result contains { blobs, settings }. There is one Blob per exported target, in target order. Dismissing the modal returns an empty blobs array. settings contains the custom field values when the modal closes.
The call fails if another export request is open, a target cannot be resolved, or no applicable generator can serve the request. An MP4-only request for a selection without video fails before the modal opens.
const selected = await kittl.state.getSelectedObjectsIds();
if (!selected.isOk) throw selected.error;
const response = await kittl.export.showExportModal({
target: selected.result,
title: 'Export design',
exportLabel: 'Export',
customFields: [
{ type: 'input', propType: 'string', name: 'fileName', label: 'File name' },
],
initialFileFormat: 'application/pdf',
});
if (!response.isOk) throw response.error;
const { blobs, settings } = response.result;
bypassExportDialog(options)
Scope: export:bypass, plus developer organization approval for EXPORT_BYPASS.
Generates an export immediately, without showing the host modal.
| Property | Type | Required | Description |
|---|---|---|---|
format | 'png' | 'jpg' | 'pdf' | 'svg' | 'mp4' | Yes | Output format |
target | { boardId: string } | { nodeIds: string[] } | Yes | Content to export |
dimensions | { multiplier: number } | { pixelCount: number } | { target: { width, height } } | No | Sizing hints (aspect ratio is preserved) |
size | { width: number; height: number; unit: Unit } | No | Explicit output size with unit |
dpi | number | No | DPI for the export (e.g. 300 for print) |
colorModel | 'rgb' | 'cmyk' | No | Color model for the output |
removeArtboardBackground | boolean | No | Strip the artboard background from the export |
optimizedQuality | boolean | No | Enable optimized quality rendering |
renderingIntent | 'download' | 'pdf' | No | Rendering intent hint |
The result contains a Blob or null if no file was produced. A declared scope without organization approval does not authorize the call. The host also checks this permission when you submit a manifest requesting it.
const response = await kittl.export.bypassExportDialog({
format: 'png',
target: { boardId: 'board-id' },
});
if (!response.isOk) throw response.error;
const blob = response.result;