@imgly/codesign-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (816) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +158 -0
  3. package/assets/docs/api/SKILL.md +49 -0
  4. package/assets/docs/api/index.d.ts +10518 -0
  5. package/assets/docs/guide/SKILL.md +142 -0
  6. package/assets/docs/guide/actions.md +1038 -0
  7. package/assets/docs/guide/animation/create/base.md +467 -0
  8. package/assets/docs/guide/animation/create/text.md +453 -0
  9. package/assets/docs/guide/animation/create.md +558 -0
  10. package/assets/docs/guide/animation/edit.md +501 -0
  11. package/assets/docs/guide/animation/overview.md +22 -0
  12. package/assets/docs/guide/animation/types.md +430 -0
  13. package/assets/docs/guide/animation.md +23 -0
  14. package/assets/docs/guide/api/AssetAPI.md +602 -0
  15. package/assets/docs/guide/api/BlockAPI.md +6152 -0
  16. package/assets/docs/guide/api/CreativeEngine.md +180 -0
  17. package/assets/docs/guide/api/EditorAPI.md +1261 -0
  18. package/assets/docs/guide/api/EventAPI.md +25 -0
  19. package/assets/docs/guide/api/SceneAPI.md +729 -0
  20. package/assets/docs/guide/api/VariableAPI.md +59 -0
  21. package/assets/docs/guide/api/types.md +71 -0
  22. package/assets/docs/guide/api-reference/overview.md +20 -0
  23. package/assets/docs/guide/automation/auto-resize.md +412 -0
  24. package/assets/docs/guide/automation/batch-processing.md +474 -0
  25. package/assets/docs/guide/automation/data-merge.md +406 -0
  26. package/assets/docs/guide/automation/design-generation.md +107 -0
  27. package/assets/docs/guide/automation/overview.md +16 -0
  28. package/assets/docs/guide/automation.md +24 -0
  29. package/assets/docs/guide/browser-support.md +38 -0
  30. package/assets/docs/guide/capabilities.md +18 -0
  31. package/assets/docs/guide/colors/adjust.md +551 -0
  32. package/assets/docs/guide/colors/apply.md +349 -0
  33. package/assets/docs/guide/colors/basics.md +440 -0
  34. package/assets/docs/guide/colors/conversion.md +504 -0
  35. package/assets/docs/guide/colors/create-color-palette.md +426 -0
  36. package/assets/docs/guide/colors/for-print/cmyk.md +577 -0
  37. package/assets/docs/guide/colors/for-print/spot.md +751 -0
  38. package/assets/docs/guide/colors/for-print.md +21 -0
  39. package/assets/docs/guide/colors/for-screen/p3.md +60 -0
  40. package/assets/docs/guide/colors/for-screen/srgb.md +463 -0
  41. package/assets/docs/guide/colors/for-screen.md +21 -0
  42. package/assets/docs/guide/colors/overview.md +20 -0
  43. package/assets/docs/guide/colors/replace.md +535 -0
  44. package/assets/docs/guide/colors.md +28 -0
  45. package/assets/docs/guide/compatibility.md +27 -0
  46. package/assets/docs/guide/concepts/architecture.md +99 -0
  47. package/assets/docs/guide/concepts/assets.md +360 -0
  48. package/assets/docs/guide/concepts/blocks.md +750 -0
  49. package/assets/docs/guide/concepts/buffers.md +546 -0
  50. package/assets/docs/guide/concepts/design-units.md +333 -0
  51. package/assets/docs/guide/concepts/edit-modes.md +431 -0
  52. package/assets/docs/guide/concepts/editing-workflow.md +303 -0
  53. package/assets/docs/guide/concepts/events.md +466 -0
  54. package/assets/docs/guide/concepts/headless-mode/browser.md +291 -0
  55. package/assets/docs/guide/concepts/pages.md +396 -0
  56. package/assets/docs/guide/concepts/resources.md +496 -0
  57. package/assets/docs/guide/concepts/scenes.md +443 -0
  58. package/assets/docs/guide/concepts/templating.md +194 -0
  59. package/assets/docs/guide/concepts/terminology.md +296 -0
  60. package/assets/docs/guide/concepts/undo-and-history.md +461 -0
  61. package/assets/docs/guide/concepts.md +38 -0
  62. package/assets/docs/guide/configuration.md +469 -0
  63. package/assets/docs/guide/conversion/overview.md +22 -0
  64. package/assets/docs/guide/conversion/to-base64.md +234 -0
  65. package/assets/docs/guide/conversion/to-pdf.md +616 -0
  66. package/assets/docs/guide/conversion/to-png.md +290 -0
  67. package/assets/docs/guide/conversion.md +23 -0
  68. package/assets/docs/guide/create-audio/audio/add-music.md +430 -0
  69. package/assets/docs/guide/create-audio/audio/add-sound-effects.md +664 -0
  70. package/assets/docs/guide/create-audio/audio/loop.md +370 -0
  71. package/assets/docs/guide/create-audio/audio.md +336 -0
  72. package/assets/docs/guide/create-composition/add-background.md +395 -0
  73. package/assets/docs/guide/create-composition/blend-modes.md +372 -0
  74. package/assets/docs/guide/create-composition/collage.md +432 -0
  75. package/assets/docs/guide/create-composition/group-and-ungroup.md +388 -0
  76. package/assets/docs/guide/create-composition/layer-management.md +503 -0
  77. package/assets/docs/guide/create-composition/layout.md +396 -0
  78. package/assets/docs/guide/create-composition/lock-design.md +362 -0
  79. package/assets/docs/guide/create-composition/multi-page.md +204 -0
  80. package/assets/docs/guide/create-composition/overview.md +18 -0
  81. package/assets/docs/guide/create-composition/programmatic.md +593 -0
  82. package/assets/docs/guide/create-composition.md +30 -0
  83. package/assets/docs/guide/create-templates/add-dynamic-content/placeholders.md +688 -0
  84. package/assets/docs/guide/create-templates/add-dynamic-content/set-editing-constraints.md +600 -0
  85. package/assets/docs/guide/create-templates/add-dynamic-content/text-variables.md +647 -0
  86. package/assets/docs/guide/create-templates/add-dynamic-content.md +307 -0
  87. package/assets/docs/guide/create-templates/add-to-template-library.md +297 -0
  88. package/assets/docs/guide/create-templates/edit-or-remove.md +441 -0
  89. package/assets/docs/guide/create-templates/from-scratch.md +558 -0
  90. package/assets/docs/guide/create-templates/import/from-scene-file.md +440 -0
  91. package/assets/docs/guide/create-templates/import.md +244 -0
  92. package/assets/docs/guide/create-templates/lock.md +325 -0
  93. package/assets/docs/guide/create-templates/overview.md +16 -0
  94. package/assets/docs/guide/create-templates.md +32 -0
  95. package/assets/docs/guide/create-video/audio/adjust-speed.md +302 -0
  96. package/assets/docs/guide/create-video/audio/adjust-volume.md +346 -0
  97. package/assets/docs/guide/create-video/control.md +285 -0
  98. package/assets/docs/guide/create-video/limitations.md +396 -0
  99. package/assets/docs/guide/create-video/overview.md +224 -0
  100. package/assets/docs/guide/create-video/timeline-editor.md +622 -0
  101. package/assets/docs/guide/create-video/update-caption-presets.md +676 -0
  102. package/assets/docs/guide/create-video.md +32 -0
  103. package/assets/docs/guide/edit-image/add-watermark.md +497 -0
  104. package/assets/docs/guide/edit-image/overview.md +22 -0
  105. package/assets/docs/guide/edit-image/remove-bg.md +420 -0
  106. package/assets/docs/guide/edit-image/replace-colors.md +680 -0
  107. package/assets/docs/guide/edit-image/transform/crop.md +523 -0
  108. package/assets/docs/guide/edit-image/transform/move.md +279 -0
  109. package/assets/docs/guide/edit-image/transform/resize.md +301 -0
  110. package/assets/docs/guide/edit-image/transform/rotate.md +408 -0
  111. package/assets/docs/guide/edit-image/transform/scale.md +278 -0
  112. package/assets/docs/guide/edit-image/transform.md +24 -0
  113. package/assets/docs/guide/edit-image/vectorize.md +204 -0
  114. package/assets/docs/guide/edit-image.md +25 -0
  115. package/assets/docs/guide/edit-video/add-captions.md +589 -0
  116. package/assets/docs/guide/edit-video/add-watermark.md +429 -0
  117. package/assets/docs/guide/edit-video/join-and-arrange.md +540 -0
  118. package/assets/docs/guide/edit-video/redaction.md +544 -0
  119. package/assets/docs/guide/edit-video/split.md +634 -0
  120. package/assets/docs/guide/edit-video/transform/crop.md +380 -0
  121. package/assets/docs/guide/edit-video/transform/flip.md +182 -0
  122. package/assets/docs/guide/edit-video/transform/move.md +413 -0
  123. package/assets/docs/guide/edit-video/transform/resize.md +534 -0
  124. package/assets/docs/guide/edit-video/transform/rotate.md +312 -0
  125. package/assets/docs/guide/edit-video/transform/scale.md +603 -0
  126. package/assets/docs/guide/edit-video/transform.md +25 -0
  127. package/assets/docs/guide/edit-video/trim.md +773 -0
  128. package/assets/docs/guide/engine-interface.md +108 -0
  129. package/assets/docs/guide/export-save-publish/create-thumbnail.md +292 -0
  130. package/assets/docs/guide/export-save-publish/export/compress.md +639 -0
  131. package/assets/docs/guide/export-save-publish/export/overview.md +576 -0
  132. package/assets/docs/guide/export-save-publish/export/partial-export.md +694 -0
  133. package/assets/docs/guide/export-save-publish/export/size-limits.md +401 -0
  134. package/assets/docs/guide/export-save-publish/export/to-html5.md +474 -0
  135. package/assets/docs/guide/export-save-publish/export/to-jpeg.md +312 -0
  136. package/assets/docs/guide/export-save-publish/export/to-mp4.md +364 -0
  137. package/assets/docs/guide/export-save-publish/export/to-pdf.md +389 -0
  138. package/assets/docs/guide/export-save-publish/export/to-png.md +255 -0
  139. package/assets/docs/guide/export-save-publish/export/to-raw-data.md +303 -0
  140. package/assets/docs/guide/export-save-publish/export/to-webp.md +261 -0
  141. package/assets/docs/guide/export-save-publish/export/with-color-mask.md +278 -0
  142. package/assets/docs/guide/export-save-publish/export.md +36 -0
  143. package/assets/docs/guide/export-save-publish/for-printing.md +423 -0
  144. package/assets/docs/guide/export-save-publish/for-social-media.md +318 -0
  145. package/assets/docs/guide/export-save-publish/pre-export-validation.md +698 -0
  146. package/assets/docs/guide/export-save-publish/save.md +340 -0
  147. package/assets/docs/guide/export-save-publish/store-custom-metadata.md +367 -0
  148. package/assets/docs/guide/file-format-support.md +34 -0
  149. package/assets/docs/guide/fills/color.md +678 -0
  150. package/assets/docs/guide/fills/image.md +539 -0
  151. package/assets/docs/guide/fills/overview.md +144 -0
  152. package/assets/docs/guide/fills/video.md +641 -0
  153. package/assets/docs/guide/fills.md +24 -0
  154. package/assets/docs/guide/filters-and-effects/apply.md +1019 -0
  155. package/assets/docs/guide/filters-and-effects/blur.md +382 -0
  156. package/assets/docs/guide/filters-and-effects/chroma-key-green-screen.md +445 -0
  157. package/assets/docs/guide/filters-and-effects/create-custom-filters.md +614 -0
  158. package/assets/docs/guide/filters-and-effects/create-custom-lut-filter.md +426 -0
  159. package/assets/docs/guide/filters-and-effects/distortion.md +527 -0
  160. package/assets/docs/guide/filters-and-effects/duotone.md +602 -0
  161. package/assets/docs/guide/filters-and-effects/gradients.md +1311 -0
  162. package/assets/docs/guide/filters-and-effects/overview.md +22 -0
  163. package/assets/docs/guide/filters-and-effects/support.md +623 -0
  164. package/assets/docs/guide/filters-and-effects.md +28 -0
  165. package/assets/docs/guide/get-started/agent-skills.md +119 -0
  166. package/assets/docs/guide/get-started/build-with-ai.md +45 -0
  167. package/assets/docs/guide/get-started/mcp-server.md +119 -0
  168. package/assets/docs/guide/get-started/overview.md +28 -0
  169. package/assets/docs/guide/get-started/vanilla-js/quickstart.md +175 -0
  170. package/assets/docs/guide/grid-and-rulers.md +222 -0
  171. package/assets/docs/guide/guides/export-save-publish/export/audio.md +224 -0
  172. package/assets/docs/guide/guides/text/rendering-internals.md +796 -0
  173. package/assets/docs/guide/guides.md +49 -0
  174. package/assets/docs/guide/import-media/asset-library.md +23 -0
  175. package/assets/docs/guide/import-media/asset-panel/basics.md +324 -0
  176. package/assets/docs/guide/import-media/asset-panel/customize.md +478 -0
  177. package/assets/docs/guide/import-media/asset-panel/refresh-assets.md +415 -0
  178. package/assets/docs/guide/import-media/asset-panel/thumbnails.md +633 -0
  179. package/assets/docs/guide/import-media/capture-from-camera/record-video.md +137 -0
  180. package/assets/docs/guide/import-media/capture-from-camera.md +20 -0
  181. package/assets/docs/guide/import-media/concepts.md +173 -0
  182. package/assets/docs/guide/import-media/content-json-schema.md +615 -0
  183. package/assets/docs/guide/import-media/default-assets.md +381 -0
  184. package/assets/docs/guide/import-media/edit-or-remove-assets.md +489 -0
  185. package/assets/docs/guide/import-media/file-format-support.md +178 -0
  186. package/assets/docs/guide/import-media/from-local-source/user-upload.md +438 -0
  187. package/assets/docs/guide/import-media/from-local-source.md +20 -0
  188. package/assets/docs/guide/import-media/from-remote-source/asset-versioning.md +390 -0
  189. package/assets/docs/guide/import-media/from-remote-source/getty-images.md +627 -0
  190. package/assets/docs/guide/import-media/from-remote-source/imgly-premium-assets.md +625 -0
  191. package/assets/docs/guide/import-media/from-remote-source/pexels.md +692 -0
  192. package/assets/docs/guide/import-media/from-remote-source/remote-asset.md +473 -0
  193. package/assets/docs/guide/import-media/from-remote-source/soundstripe.md +497 -0
  194. package/assets/docs/guide/import-media/from-remote-source/third-party.md +51 -0
  195. package/assets/docs/guide/import-media/from-remote-source/unsplash.md +914 -0
  196. package/assets/docs/guide/import-media/from-remote-source/your-server.md +764 -0
  197. package/assets/docs/guide/import-media/from-remote-source.md +28 -0
  198. package/assets/docs/guide/import-media/overview.md +32 -0
  199. package/assets/docs/guide/import-media/retrieve-mimetype.md +274 -0
  200. package/assets/docs/guide/import-media/size-limits.md +20 -0
  201. package/assets/docs/guide/import-media/source-sets.md +476 -0
  202. package/assets/docs/guide/import-media.md +32 -0
  203. package/assets/docs/guide/insert-media/audio.md +291 -0
  204. package/assets/docs/guide/insert-media/images.md +380 -0
  205. package/assets/docs/guide/insert-media/position-and-align.md +734 -0
  206. package/assets/docs/guide/insert-media/shapes-or-stickers.md +799 -0
  207. package/assets/docs/guide/insert-media/videos.md +308 -0
  208. package/assets/docs/guide/insert-media.md +24 -0
  209. package/assets/docs/guide/key-capabilities.md +24 -0
  210. package/assets/docs/guide/key-concepts.md +83 -0
  211. package/assets/docs/guide/licensing.md +45 -0
  212. package/assets/docs/guide/llms-txt.md +53 -0
  213. package/assets/docs/guide/open-the-editor/blank-canvas.md +124 -0
  214. package/assets/docs/guide/open-the-editor/from-htmlcanvas.md +228 -0
  215. package/assets/docs/guide/open-the-editor/from-image.md +205 -0
  216. package/assets/docs/guide/open-the-editor/from-template.md +189 -0
  217. package/assets/docs/guide/open-the-editor/from-video.md +274 -0
  218. package/assets/docs/guide/open-the-editor/import-design/from-archive.md +504 -0
  219. package/assets/docs/guide/open-the-editor/import-design/from-indesign.md +680 -0
  220. package/assets/docs/guide/open-the-editor/import-design/from-photoshop.md +865 -0
  221. package/assets/docs/guide/open-the-editor/import-design.md +481 -0
  222. package/assets/docs/guide/open-the-editor/load-scene.md +178 -0
  223. package/assets/docs/guide/open-the-editor/overview.md +20 -0
  224. package/assets/docs/guide/open-the-editor/set-zoom-level.md +303 -0
  225. package/assets/docs/guide/open-the-editor/uri-resolver.md +347 -0
  226. package/assets/docs/guide/open-the-editor.md +29 -0
  227. package/assets/docs/guide/outlines/overview.md +14 -0
  228. package/assets/docs/guide/outlines/shadows-and-glows.md +515 -0
  229. package/assets/docs/guide/outlines/strokes.md +292 -0
  230. package/assets/docs/guide/outlines.md +22 -0
  231. package/assets/docs/guide/overview.md +22 -0
  232. package/assets/docs/guide/performance.md +217 -0
  233. package/assets/docs/guide/plugins/asset-sources.md +553 -0
  234. package/assets/docs/guide/plugins/print-ready-pdf.md +549 -0
  235. package/assets/docs/guide/plugins.md +36 -0
  236. package/assets/docs/guide/rules/asset-handling.md +180 -0
  237. package/assets/docs/guide/rules/common-pitfalls.md +272 -0
  238. package/assets/docs/guide/rules/content-fill-mode.md +29 -0
  239. package/assets/docs/guide/rules/enforce-brand-guidelines.md +672 -0
  240. package/assets/docs/guide/rules/lock-content.md +478 -0
  241. package/assets/docs/guide/rules/moderate-content.md +761 -0
  242. package/assets/docs/guide/rules/overview.md +514 -0
  243. package/assets/docs/guide/rules/silent-init-errors.md +137 -0
  244. package/assets/docs/guide/rules/verify-properties-before-use.md +78 -0
  245. package/assets/docs/guide/rules.md +23 -0
  246. package/assets/docs/guide/security.md +199 -0
  247. package/assets/docs/guide/serve-assets.md +332 -0
  248. package/assets/docs/guide/settings.md +199 -0
  249. package/assets/docs/guide/shapes.md +23 -0
  250. package/assets/docs/guide/starterkits/3d-mockup-editor.md +748 -0
  251. package/assets/docs/guide/starterkits/advanced-editor.md +698 -0
  252. package/assets/docs/guide/starterkits/advanced-video-editor.md +696 -0
  253. package/assets/docs/guide/starterkits/ai-editor.md +749 -0
  254. package/assets/docs/guide/starterkits/airtable-image-editor.md +672 -0
  255. package/assets/docs/guide/starterkits/apparel-ui.md +188 -0
  256. package/assets/docs/guide/starterkits/assets.md +27 -0
  257. package/assets/docs/guide/starterkits/auto-resize.md +586 -0
  258. package/assets/docs/guide/starterkits/automated-video-generation.md +692 -0
  259. package/assets/docs/guide/starterkits/background-removal-editor.md +480 -0
  260. package/assets/docs/guide/starterkits/content-moderation.md +863 -0
  261. package/assets/docs/guide/starterkits/creative-automation.md +28 -0
  262. package/assets/docs/guide/starterkits/custom-built-uis.md +26 -0
  263. package/assets/docs/guide/starterkits/customization.md +29 -0
  264. package/assets/docs/guide/starterkits/cutout-lines-editor.md +470 -0
  265. package/assets/docs/guide/starterkits/data-merge.md +850 -0
  266. package/assets/docs/guide/starterkits/design-editor.md +698 -0
  267. package/assets/docs/guide/starterkits/design-generation.md +719 -0
  268. package/assets/docs/guide/starterkits/design-validation.md +808 -0
  269. package/assets/docs/guide/starterkits/editor-ui-configurations.md +14 -0
  270. package/assets/docs/guide/starterkits/export-options.md +724 -0
  271. package/assets/docs/guide/starterkits/export-using-renderer.md +708 -0
  272. package/assets/docs/guide/starterkits/extensibility.md +28 -0
  273. package/assets/docs/guide/starterkits/force-crop-editor.md +675 -0
  274. package/assets/docs/guide/starterkits/form-based-template-adoption.md +522 -0
  275. package/assets/docs/guide/starterkits/getty-images-editor.md +700 -0
  276. package/assets/docs/guide/starterkits/html5-ads-exporter.md +719 -0
  277. package/assets/docs/guide/starterkits/indesign-template-import.md +580 -0
  278. package/assets/docs/guide/starterkits/layouts-editor.md +724 -0
  279. package/assets/docs/guide/starterkits/mobile-ui.md +185 -0
  280. package/assets/docs/guide/starterkits/mockup-editor.md +745 -0
  281. package/assets/docs/guide/starterkits/multi-image-generation.md +542 -0
  282. package/assets/docs/guide/starterkits/page-sizes-editor.md +657 -0
  283. package/assets/docs/guide/starterkits/pexels-image-editor.md +665 -0
  284. package/assets/docs/guide/starterkits/photo-editor.md +755 -0
  285. package/assets/docs/guide/starterkits/photo-ui.md +186 -0
  286. package/assets/docs/guide/starterkits/photobook-ui.md +188 -0
  287. package/assets/docs/guide/starterkits/placeholders.md +678 -0
  288. package/assets/docs/guide/starterkits/player.md +405 -0
  289. package/assets/docs/guide/starterkits/plugins.md +25 -0
  290. package/assets/docs/guide/starterkits/postcard-editor.md +202 -0
  291. package/assets/docs/guide/starterkits/pptx-template-import.md +581 -0
  292. package/assets/docs/guide/starterkits/print-ready-pdf-editor.md +746 -0
  293. package/assets/docs/guide/starterkits/product-editor.md +773 -0
  294. package/assets/docs/guide/starterkits/psd-template-import.md +580 -0
  295. package/assets/docs/guide/starterkits/qr-code-editor.md +470 -0
  296. package/assets/docs/guide/starterkits/single-page-editor.md +661 -0
  297. package/assets/docs/guide/starterkits/start-with-image.md +684 -0
  298. package/assets/docs/guide/starterkits/start-with-video.md +651 -0
  299. package/assets/docs/guide/starterkits/t-shirt-designer.md +742 -0
  300. package/assets/docs/guide/starterkits/templating.md +23 -0
  301. package/assets/docs/guide/starterkits/theming.md +662 -0
  302. package/assets/docs/guide/starterkits/translation-internationalization.md +662 -0
  303. package/assets/docs/guide/starterkits/unsplash-editor.md +839 -0
  304. package/assets/docs/guide/starterkits/vectorizer-editor.md +466 -0
  305. package/assets/docs/guide/starterkits/version-history.md +745 -0
  306. package/assets/docs/guide/starterkits/video-animations.md +853 -0
  307. package/assets/docs/guide/starterkits/video-captions.md +884 -0
  308. package/assets/docs/guide/starterkits/video-editing.md +25 -0
  309. package/assets/docs/guide/starterkits/video-editor.md +696 -0
  310. package/assets/docs/guide/starterkits/video-export-options.md +676 -0
  311. package/assets/docs/guide/starterkits/viewer.md +400 -0
  312. package/assets/docs/guide/starterkits.md +41 -0
  313. package/assets/docs/guide/stickers-and-shapes/combine.md +743 -0
  314. package/assets/docs/guide/stickers-and-shapes/create-cutout.md +425 -0
  315. package/assets/docs/guide/stickers-and-shapes/create-edit/create-shapes.md +794 -0
  316. package/assets/docs/guide/stickers-and-shapes/create-edit/create-stickers.md +290 -0
  317. package/assets/docs/guide/stickers-and-shapes/create-edit/edit-shapes.md +211 -0
  318. package/assets/docs/guide/stickers-and-shapes/create-edit/vector-edit.md +362 -0
  319. package/assets/docs/guide/stickers-and-shapes/insert-qr-code.md +208 -0
  320. package/assets/docs/guide/stickers.md +21 -0
  321. package/assets/docs/guide/text/add.md +641 -0
  322. package/assets/docs/guide/text/adjust-spacing.md +288 -0
  323. package/assets/docs/guide/text/auto-size.md +404 -0
  324. package/assets/docs/guide/text/custom-fonts.md +401 -0
  325. package/assets/docs/guide/text/decorations.md +330 -0
  326. package/assets/docs/guide/text/edit.md +458 -0
  327. package/assets/docs/guide/text/effects.md +244 -0
  328. package/assets/docs/guide/text/emojis.md +310 -0
  329. package/assets/docs/guide/text/enumerations.md +258 -0
  330. package/assets/docs/guide/text/language-support.md +604 -0
  331. package/assets/docs/guide/text/overview.md +14 -0
  332. package/assets/docs/guide/text/styling.md +390 -0
  333. package/assets/docs/guide/text/text-designs.md +834 -0
  334. package/assets/docs/guide/text.md +33 -0
  335. package/assets/docs/guide/to-v1-10.md +131 -0
  336. package/assets/docs/guide/to-v1-13.md +165 -0
  337. package/assets/docs/guide/to-v1-19.md +315 -0
  338. package/assets/docs/guide/to-v1-32.md +110 -0
  339. package/assets/docs/guide/to-v1-69.md +468 -0
  340. package/assets/docs/guide/to-v1-72.md +193 -0
  341. package/assets/docs/guide/upgrade.md +25 -0
  342. package/assets/docs/guide/use-templates/apply-template.md +279 -0
  343. package/assets/docs/guide/use-templates/generate.md +405 -0
  344. package/assets/docs/guide/use-templates/library.md +450 -0
  345. package/assets/docs/guide/use-templates/overview.md +20 -0
  346. package/assets/docs/guide/use-templates/programmatic.md +482 -0
  347. package/assets/docs/guide/use-templates/replace-content.md +399 -0
  348. package/assets/docs/guide/user-interface/ai-integration/audio-generation.md +428 -0
  349. package/assets/docs/guide/user-interface/ai-integration/auto-captions.md +337 -0
  350. package/assets/docs/guide/user-interface/ai-integration/custom-provider.md +853 -0
  351. package/assets/docs/guide/user-interface/ai-integration/gateway-provider.md +1045 -0
  352. package/assets/docs/guide/user-interface/ai-integration/image-generation.md +641 -0
  353. package/assets/docs/guide/user-interface/ai-integration/integrate.md +966 -0
  354. package/assets/docs/guide/user-interface/ai-integration/proxy-server.md +99 -0
  355. package/assets/docs/guide/user-interface/ai-integration/text-generation.md +498 -0
  356. package/assets/docs/guide/user-interface/ai-integration/video-generation.md +493 -0
  357. package/assets/docs/guide/user-interface/ai-integration.md +30 -0
  358. package/assets/docs/guide/user-interface/appearance/change-ui-font.md +316 -0
  359. package/assets/docs/guide/user-interface/appearance/custom-labels.md +509 -0
  360. package/assets/docs/guide/user-interface/appearance/icons.md +373 -0
  361. package/assets/docs/guide/user-interface/appearance/theming.md +665 -0
  362. package/assets/docs/guide/user-interface/appearance.md +23 -0
  363. package/assets/docs/guide/user-interface/build-your-own-ui.md +620 -0
  364. package/assets/docs/guide/user-interface/customization/canvas-menu.md +412 -0
  365. package/assets/docs/guide/user-interface/customization/canvas.md +281 -0
  366. package/assets/docs/guide/user-interface/customization/color-palette.md +413 -0
  367. package/assets/docs/guide/user-interface/customization/crop-presets.md +384 -0
  368. package/assets/docs/guide/user-interface/customization/disable-or-enable.md +676 -0
  369. package/assets/docs/guide/user-interface/customization/dock.md +399 -0
  370. package/assets/docs/guide/user-interface/customization/force-crop.md +289 -0
  371. package/assets/docs/guide/user-interface/customization/inspector-bar.md +371 -0
  372. package/assets/docs/guide/user-interface/customization/navigation-bar.md +516 -0
  373. package/assets/docs/guide/user-interface/customization/page-format.md +436 -0
  374. package/assets/docs/guide/user-interface/customization/panel.md +605 -0
  375. package/assets/docs/guide/user-interface/customization/quick-start/add-action-buttons.md +531 -0
  376. package/assets/docs/guide/user-interface/customization/quick-start/add-dock-buttons.md +358 -0
  377. package/assets/docs/guide/user-interface/customization/quick-start/create-custom-components.md +374 -0
  378. package/assets/docs/guide/user-interface/customization/quick-start/reorder-components.md +323 -0
  379. package/assets/docs/guide/user-interface/customization/quick-start/show-hide-components.md +294 -0
  380. package/assets/docs/guide/user-interface/customization/quick-start.md +12 -0
  381. package/assets/docs/guide/user-interface/customization/reference/component-order-api.md +519 -0
  382. package/assets/docs/guide/user-interface/customization/reference/component-reference.md +333 -0
  383. package/assets/docs/guide/user-interface/customization/reference.md +12 -0
  384. package/assets/docs/guide/user-interface/customization.md +39 -0
  385. package/assets/docs/guide/user-interface/localization.md +633 -0
  386. package/assets/docs/guide/user-interface/overview.md +167 -0
  387. package/assets/docs/guide/user-interface/ui-extensions/add-custom-feature.md +411 -0
  388. package/assets/docs/guide/user-interface/ui-extensions/asset-library.md +721 -0
  389. package/assets/docs/guide/user-interface/ui-extensions/create-custom-panel.md +331 -0
  390. package/assets/docs/guide/user-interface/ui-extensions/customize-behaviour.md +553 -0
  391. package/assets/docs/guide/user-interface/ui-extensions/notifications-and-dialogs.md +672 -0
  392. package/assets/docs/guide/user-interface/ui-extensions/quick-actions.md +415 -0
  393. package/assets/docs/guide/user-interface/ui-extensions/register-new-component.md +521 -0
  394. package/assets/docs/guide/user-interface/ui-extensions.md +26 -0
  395. package/assets/docs/guide/user-interface.md +25 -0
  396. package/assets/docs/guide/what-is-cesdk.md +319 -0
  397. package/assets/docs/handbook/SKILL.md +521 -0
  398. package/assets/prompts/evals-assetGenerate.md +12 -0
  399. package/assets/prompts/evals-brutalistCore.md +34 -0
  400. package/assets/prompts/evals-danskCatalogue.md +31 -0
  401. package/assets/prompts/evals-exportRoundTrip.md +12 -0
  402. package/assets/prompts/evals-inspectPriorCode.md +16 -0
  403. package/assets/prompts/evals-listProjectFiles.md +6 -0
  404. package/assets/prompts/evals-readAndExplainScript.md +6 -0
  405. package/assets/prompts/evals-resumeAcrossRestart.md +15 -0
  406. package/assets/prompts/evals-rewindRecovery.md +10 -0
  407. package/assets/prompts/evals-searchAcrossFiles.md +6 -0
  408. package/assets/prompts/evals-weddingCard.md +20 -0
  409. package/assets/prompts/explain.md +6 -0
  410. package/assets/prompts/review.md +6 -0
  411. package/dist/assets/inline.generated.d.ts +2 -0
  412. package/dist/assets/inline.generated.d.ts.map +1 -0
  413. package/dist/assets/inline.generated.js +413 -0
  414. package/dist/assets/inline.generated.js.map +1 -0
  415. package/dist/assets/load-browser.d.ts +8 -0
  416. package/dist/assets/load-browser.d.ts.map +1 -0
  417. package/dist/assets/load-browser.js +11 -0
  418. package/dist/assets/load-browser.js.map +1 -0
  419. package/dist/assets/load-node.d.ts +8 -0
  420. package/dist/assets/load-node.d.ts.map +1 -0
  421. package/dist/assets/load-node.js +11 -0
  422. package/dist/assets/load-node.js.map +1 -0
  423. package/dist/cli/http.d.ts +2 -0
  424. package/dist/cli/http.d.ts.map +1 -0
  425. package/dist/cli/http.js +231 -0
  426. package/dist/cli/http.js.map +1 -0
  427. package/dist/cli/redirect-console.d.ts +10 -0
  428. package/dist/cli/redirect-console.d.ts.map +1 -0
  429. package/dist/cli/redirect-console.js +18 -0
  430. package/dist/cli/redirect-console.js.map +1 -0
  431. package/dist/cli/resolve-license.d.ts +2 -0
  432. package/dist/cli/resolve-license.d.ts.map +1 -0
  433. package/dist/cli/resolve-license.js +13 -0
  434. package/dist/cli/resolve-license.js.map +1 -0
  435. package/dist/cli/stdio.d.ts +2 -0
  436. package/dist/cli/stdio.d.ts.map +1 -0
  437. package/dist/cli/stdio.js +124 -0
  438. package/dist/cli/stdio.js.map +1 -0
  439. package/dist/cli/trial-license.generated.d.ts +2 -0
  440. package/dist/cli/trial-license.generated.d.ts.map +1 -0
  441. package/dist/cli/trial-license.generated.js +4 -0
  442. package/dist/cli/trial-license.generated.js.map +1 -0
  443. package/dist/cli.d.ts +3 -0
  444. package/dist/cli.d.ts.map +1 -0
  445. package/dist/cli.js +64 -0
  446. package/dist/cli.js.map +1 -0
  447. package/dist/config.d.ts +61 -0
  448. package/dist/config.d.ts.map +1 -0
  449. package/dist/config.js +102 -0
  450. package/dist/config.js.map +1 -0
  451. package/dist/cross-ref.d.ts +2 -0
  452. package/dist/cross-ref.d.ts.map +1 -0
  453. package/dist/cross-ref.js +31 -0
  454. package/dist/cross-ref.js.map +1 -0
  455. package/dist/dashboard/router.d.ts +3 -0
  456. package/dist/dashboard/router.d.ts.map +1 -0
  457. package/dist/dashboard/router.js +19 -0
  458. package/dist/dashboard/router.js.map +1 -0
  459. package/dist/dashboard/spa-assets.generated.d.ts +2 -0
  460. package/dist/dashboard/spa-assets.generated.d.ts.map +1 -0
  461. package/dist/dashboard/spa-assets.generated.js +220 -0
  462. package/dist/dashboard/spa-assets.generated.js.map +1 -0
  463. package/dist/engine/asset-sources.d.ts +17 -0
  464. package/dist/engine/asset-sources.d.ts.map +1 -0
  465. package/dist/engine/asset-sources.js +75 -0
  466. package/dist/engine/asset-sources.js.map +1 -0
  467. package/dist/engine/cesdk-adapter.d.ts +10 -0
  468. package/dist/engine/cesdk-adapter.d.ts.map +1 -0
  469. package/dist/engine/cesdk-adapter.js +19 -0
  470. package/dist/engine/cesdk-adapter.js.map +1 -0
  471. package/dist/engine/index.d.ts +3 -0
  472. package/dist/engine/index.d.ts.map +1 -0
  473. package/dist/engine/index.js +3 -0
  474. package/dist/engine/index.js.map +1 -0
  475. package/dist/engine/mutex.d.ts +5 -0
  476. package/dist/engine/mutex.d.ts.map +1 -0
  477. package/dist/engine/mutex.js +42 -0
  478. package/dist/engine/mutex.js.map +1 -0
  479. package/dist/engine/session.d.ts +50 -0
  480. package/dist/engine/session.d.ts.map +1 -0
  481. package/dist/engine/session.js +95 -0
  482. package/dist/engine/session.js.map +1 -0
  483. package/dist/engine/uri-resolver.d.ts +14 -0
  484. package/dist/engine/uri-resolver.d.ts.map +1 -0
  485. package/dist/engine/uri-resolver.js +12 -0
  486. package/dist/engine/uri-resolver.js.map +1 -0
  487. package/dist/frontmatter.d.ts +15 -0
  488. package/dist/frontmatter.d.ts.map +1 -0
  489. package/dist/frontmatter.js +46 -0
  490. package/dist/frontmatter.js.map +1 -0
  491. package/dist/gateway/hosted-stub.d.ts +6 -0
  492. package/dist/gateway/hosted-stub.d.ts.map +1 -0
  493. package/dist/gateway/hosted-stub.js +11 -0
  494. package/dist/gateway/hosted-stub.js.map +1 -0
  495. package/dist/gateway/index.d.ts +4 -0
  496. package/dist/gateway/index.d.ts.map +1 -0
  497. package/dist/gateway/index.js +4 -0
  498. package/dist/gateway/index.js.map +1 -0
  499. package/dist/gateway/local.d.ts +14 -0
  500. package/dist/gateway/local.d.ts.map +1 -0
  501. package/dist/gateway/local.js +41 -0
  502. package/dist/gateway/local.js.map +1 -0
  503. package/dist/gateway/types.d.ts +24 -0
  504. package/dist/gateway/types.d.ts.map +1 -0
  505. package/dist/gateway/types.js +7 -0
  506. package/dist/gateway/types.js.map +1 -0
  507. package/dist/http/server.d.ts +80 -0
  508. package/dist/http/server.d.ts.map +1 -0
  509. package/dist/http/server.js +183 -0
  510. package/dist/http/server.js.map +1 -0
  511. package/dist/http/session-manager.d.ts +42 -0
  512. package/dist/http/session-manager.d.ts.map +1 -0
  513. package/dist/http/session-manager.js +82 -0
  514. package/dist/http/session-manager.js.map +1 -0
  515. package/dist/http/workspace-auth.d.ts +9 -0
  516. package/dist/http/workspace-auth.d.ts.map +1 -0
  517. package/dist/http/workspace-auth.js +29 -0
  518. package/dist/http/workspace-auth.js.map +1 -0
  519. package/dist/index.d.ts +10 -0
  520. package/dist/index.d.ts.map +1 -0
  521. package/dist/index.js +10 -0
  522. package/dist/index.js.map +1 -0
  523. package/dist/metrics/mount.d.ts +11 -0
  524. package/dist/metrics/mount.d.ts.map +1 -0
  525. package/dist/metrics/mount.js +13 -0
  526. package/dist/metrics/mount.js.map +1 -0
  527. package/dist/metrics/recorder.d.ts +55 -0
  528. package/dist/metrics/recorder.d.ts.map +1 -0
  529. package/dist/metrics/recorder.js +97 -0
  530. package/dist/metrics/recorder.js.map +1 -0
  531. package/dist/revisions/hash.d.ts +7 -0
  532. package/dist/revisions/hash.d.ts.map +1 -0
  533. package/dist/revisions/hash.js +24 -0
  534. package/dist/revisions/hash.js.map +1 -0
  535. package/dist/revisions/index.d.ts +4 -0
  536. package/dist/revisions/index.d.ts.map +1 -0
  537. package/dist/revisions/index.js +4 -0
  538. package/dist/revisions/index.js.map +1 -0
  539. package/dist/revisions/store.d.ts +69 -0
  540. package/dist/revisions/store.d.ts.map +1 -0
  541. package/dist/revisions/store.js +196 -0
  542. package/dist/revisions/store.js.map +1 -0
  543. package/dist/revisions/types.d.ts +39 -0
  544. package/dist/revisions/types.d.ts.map +1 -0
  545. package/dist/revisions/types.js +2 -0
  546. package/dist/revisions/types.js.map +1 -0
  547. package/dist/server.d.ts +51 -0
  548. package/dist/server.d.ts.map +1 -0
  549. package/dist/server.js +175 -0
  550. package/dist/server.js.map +1 -0
  551. package/dist/skill-tools.d.ts +3 -0
  552. package/dist/skill-tools.d.ts.map +1 -0
  553. package/dist/skill-tools.js +105 -0
  554. package/dist/skill-tools.js.map +1 -0
  555. package/dist/test/test/cli/dispatcher.test.d.ts +2 -0
  556. package/dist/test/test/cli/dispatcher.test.d.ts.map +1 -0
  557. package/dist/test/test/cli/dispatcher.test.js +47 -0
  558. package/dist/test/test/cli/dispatcher.test.js.map +1 -0
  559. package/dist/test/test/cross-ref.test.d.ts +2 -0
  560. package/dist/test/test/cross-ref.test.d.ts.map +1 -0
  561. package/dist/test/test/cross-ref.test.js +39 -0
  562. package/dist/test/test/cross-ref.test.js.map +1 -0
  563. package/dist/test/test/engine/session.test.d.ts +2 -0
  564. package/dist/test/test/engine/session.test.d.ts.map +1 -0
  565. package/dist/test/test/engine/session.test.js +144 -0
  566. package/dist/test/test/engine/session.test.js.map +1 -0
  567. package/dist/test/test/engine/uri-resolver.test.d.ts +2 -0
  568. package/dist/test/test/engine/uri-resolver.test.d.ts.map +1 -0
  569. package/dist/test/test/engine/uri-resolver.test.js +38 -0
  570. package/dist/test/test/engine/uri-resolver.test.js.map +1 -0
  571. package/dist/test/test/frontmatter.test.d.ts +2 -0
  572. package/dist/test/test/frontmatter.test.d.ts.map +1 -0
  573. package/dist/test/test/frontmatter.test.js +55 -0
  574. package/dist/test/test/frontmatter.test.js.map +1 -0
  575. package/dist/test/test/gateway/hosted-stub.test.d.ts +2 -0
  576. package/dist/test/test/gateway/hosted-stub.test.d.ts.map +1 -0
  577. package/dist/test/test/gateway/hosted-stub.test.js +11 -0
  578. package/dist/test/test/gateway/hosted-stub.test.js.map +1 -0
  579. package/dist/test/test/gateway/local.test.d.ts +2 -0
  580. package/dist/test/test/gateway/local.test.d.ts.map +1 -0
  581. package/dist/test/test/gateway/local.test.js +29 -0
  582. package/dist/test/test/gateway/local.test.js.map +1 -0
  583. package/dist/test/test/handbook-contract.test.d.ts +2 -0
  584. package/dist/test/test/handbook-contract.test.d.ts.map +1 -0
  585. package/dist/test/test/handbook-contract.test.js +71 -0
  586. package/dist/test/test/handbook-contract.test.js.map +1 -0
  587. package/dist/test/test/http/server.test.d.ts +2 -0
  588. package/dist/test/test/http/server.test.d.ts.map +1 -0
  589. package/dist/test/test/http/server.test.js +245 -0
  590. package/dist/test/test/http/server.test.js.map +1 -0
  591. package/dist/test/test/http/session-manager.test.d.ts +2 -0
  592. package/dist/test/test/http/session-manager.test.d.ts.map +1 -0
  593. package/dist/test/test/http/session-manager.test.js +83 -0
  594. package/dist/test/test/http/session-manager.test.js.map +1 -0
  595. package/dist/test/test/revisions/hash.test.d.ts +2 -0
  596. package/dist/test/test/revisions/hash.test.d.ts.map +1 -0
  597. package/dist/test/test/revisions/hash.test.js +33 -0
  598. package/dist/test/test/revisions/hash.test.js.map +1 -0
  599. package/dist/test/test/revisions/store.test.d.ts +2 -0
  600. package/dist/test/test/revisions/store.test.d.ts.map +1 -0
  601. package/dist/test/test/revisions/store.test.js +245 -0
  602. package/dist/test/test/revisions/store.test.js.map +1 -0
  603. package/dist/test/test/server.test.d.ts +2 -0
  604. package/dist/test/test/server.test.d.ts.map +1 -0
  605. package/dist/test/test/server.test.js +157 -0
  606. package/dist/test/test/server.test.js.map +1 -0
  607. package/dist/test/test/skill-tools.test.d.ts +2 -0
  608. package/dist/test/test/skill-tools.test.d.ts.map +1 -0
  609. package/dist/test/test/skill-tools.test.js +84 -0
  610. package/dist/test/test/skill-tools.test.js.map +1 -0
  611. package/dist/test/test/smoke.test.d.ts +2 -0
  612. package/dist/test/test/smoke.test.d.ts.map +1 -0
  613. package/dist/test/test/smoke.test.js +8 -0
  614. package/dist/test/test/smoke.test.js.map +1 -0
  615. package/dist/test/test/tools/asset-generate.test.d.ts +2 -0
  616. package/dist/test/test/tools/asset-generate.test.d.ts.map +1 -0
  617. package/dist/test/test/tools/asset-generate.test.js +66 -0
  618. package/dist/test/test/tools/asset-generate.test.js.map +1 -0
  619. package/dist/test/test/tools/edit.test.d.ts +2 -0
  620. package/dist/test/test/tools/edit.test.d.ts.map +1 -0
  621. package/dist/test/test/tools/edit.test.js +205 -0
  622. package/dist/test/test/tools/edit.test.js.map +1 -0
  623. package/dist/test/test/tools/export.test.d.ts +2 -0
  624. package/dist/test/test/tools/export.test.d.ts.map +1 -0
  625. package/dist/test/test/tools/export.test.js +144 -0
  626. package/dist/test/test/tools/export.test.js.map +1 -0
  627. package/dist/test/test/tools/history.test.d.ts +2 -0
  628. package/dist/test/test/tools/history.test.d.ts.map +1 -0
  629. package/dist/test/test/tools/history.test.js +29 -0
  630. package/dist/test/test/tools/history.test.js.map +1 -0
  631. package/dist/test/test/tools/inspect.test.d.ts +2 -0
  632. package/dist/test/test/tools/inspect.test.d.ts.map +1 -0
  633. package/dist/test/test/tools/inspect.test.js +62 -0
  634. package/dist/test/test/tools/inspect.test.js.map +1 -0
  635. package/dist/test/test/tools/list.test.d.ts +2 -0
  636. package/dist/test/test/tools/list.test.d.ts.map +1 -0
  637. package/dist/test/test/tools/list.test.js +23 -0
  638. package/dist/test/test/tools/list.test.js.map +1 -0
  639. package/dist/test/test/tools/open-editor.test.d.ts +2 -0
  640. package/dist/test/test/tools/open-editor.test.d.ts.map +1 -0
  641. package/dist/test/test/tools/open-editor.test.js +53 -0
  642. package/dist/test/test/tools/open-editor.test.js.map +1 -0
  643. package/dist/test/test/tools/preview.test.d.ts +2 -0
  644. package/dist/test/test/tools/preview.test.d.ts.map +1 -0
  645. package/dist/test/test/tools/preview.test.js +73 -0
  646. package/dist/test/test/tools/preview.test.js.map +1 -0
  647. package/dist/test/test/tools/rename.test.d.ts +2 -0
  648. package/dist/test/test/tools/rename.test.d.ts.map +1 -0
  649. package/dist/test/test/tools/rename.test.js +17 -0
  650. package/dist/test/test/tools/rename.test.js.map +1 -0
  651. package/dist/test/test/viewer/broadcaster.test.d.ts +2 -0
  652. package/dist/test/test/viewer/broadcaster.test.d.ts.map +1 -0
  653. package/dist/test/test/viewer/broadcaster.test.js +53 -0
  654. package/dist/test/test/viewer/broadcaster.test.js.map +1 -0
  655. package/dist/test/test/viewer/resource-route.test.d.ts +2 -0
  656. package/dist/test/test/viewer/resource-route.test.d.ts.map +1 -0
  657. package/dist/test/test/viewer/resource-route.test.js +70 -0
  658. package/dist/test/test/viewer/resource-route.test.js.map +1 -0
  659. package/dist/test/test/viewer/router.test.d.ts +2 -0
  660. package/dist/test/test/viewer/router.test.d.ts.map +1 -0
  661. package/dist/test/test/viewer/router.test.js +171 -0
  662. package/dist/test/test/viewer/router.test.js.map +1 -0
  663. package/dist/test/test/viewer/url-builder.test.d.ts +2 -0
  664. package/dist/test/test/viewer/url-builder.test.d.ts.map +1 -0
  665. package/dist/test/test/viewer/url-builder.test.js +31 -0
  666. package/dist/test/test/viewer/url-builder.test.js.map +1 -0
  667. package/dist/test/test/workspace/hosted-stub.test.d.ts +2 -0
  668. package/dist/test/test/workspace/hosted-stub.test.d.ts.map +1 -0
  669. package/dist/test/test/workspace/hosted-stub.test.js +30 -0
  670. package/dist/test/test/workspace/hosted-stub.test.js.map +1 -0
  671. package/dist/test/test/workspace/in-memory.test.d.ts +2 -0
  672. package/dist/test/test/workspace/in-memory.test.d.ts.map +1 -0
  673. package/dist/test/test/workspace/in-memory.test.js +4 -0
  674. package/dist/test/test/workspace/in-memory.test.js.map +1 -0
  675. package/dist/test/test/workspace/node-fs.test.d.ts +2 -0
  676. package/dist/test/test/workspace/node-fs.test.d.ts.map +1 -0
  677. package/dist/test/test/workspace/node-fs.test.js +20 -0
  678. package/dist/test/test/workspace/node-fs.test.js.map +1 -0
  679. package/dist/test/test/workspace/shared-contract.d.ts +3 -0
  680. package/dist/test/test/workspace/shared-contract.d.ts.map +1 -0
  681. package/dist/test/test/workspace/shared-contract.js +92 -0
  682. package/dist/test/test/workspace/shared-contract.js.map +1 -0
  683. package/dist/test/tsconfig.test.tsbuildinfo +1 -0
  684. package/dist/test/vitest.config.d.ts +3 -0
  685. package/dist/test/vitest.config.d.ts.map +1 -0
  686. package/dist/test/vitest.config.js +8 -0
  687. package/dist/test/vitest.config.js.map +1 -0
  688. package/dist/tools/asset-generate.d.ts +12 -0
  689. package/dist/tools/asset-generate.d.ts.map +1 -0
  690. package/dist/tools/asset-generate.js +112 -0
  691. package/dist/tools/asset-generate.js.map +1 -0
  692. package/dist/tools/asset-search.d.ts +10 -0
  693. package/dist/tools/asset-search.d.ts.map +1 -0
  694. package/dist/tools/asset-search.js +120 -0
  695. package/dist/tools/asset-search.js.map +1 -0
  696. package/dist/tools/content-types.d.ts +11 -0
  697. package/dist/tools/content-types.d.ts.map +1 -0
  698. package/dist/tools/content-types.js +2 -0
  699. package/dist/tools/content-types.js.map +1 -0
  700. package/dist/tools/edit.d.ts +29 -0
  701. package/dist/tools/edit.d.ts.map +1 -0
  702. package/dist/tools/edit.js +165 -0
  703. package/dist/tools/edit.js.map +1 -0
  704. package/dist/tools/engine.d.ts +31 -0
  705. package/dist/tools/engine.d.ts.map +1 -0
  706. package/dist/tools/engine.js +59 -0
  707. package/dist/tools/engine.js.map +1 -0
  708. package/dist/tools/export.d.ts +19 -0
  709. package/dist/tools/export.d.ts.map +1 -0
  710. package/dist/tools/export.js +179 -0
  711. package/dist/tools/export.js.map +1 -0
  712. package/dist/tools/history.d.ts +7 -0
  713. package/dist/tools/history.d.ts.map +1 -0
  714. package/dist/tools/history.js +54 -0
  715. package/dist/tools/history.js.map +1 -0
  716. package/dist/tools/index.d.ts +35 -0
  717. package/dist/tools/index.d.ts.map +1 -0
  718. package/dist/tools/index.js +72 -0
  719. package/dist/tools/index.js.map +1 -0
  720. package/dist/tools/inspect.d.ts +7 -0
  721. package/dist/tools/inspect.d.ts.map +1 -0
  722. package/dist/tools/inspect.js +80 -0
  723. package/dist/tools/inspect.js.map +1 -0
  724. package/dist/tools/list.d.ts +7 -0
  725. package/dist/tools/list.d.ts.map +1 -0
  726. package/dist/tools/list.js +18 -0
  727. package/dist/tools/list.js.map +1 -0
  728. package/dist/tools/metrics.d.ts +11 -0
  729. package/dist/tools/metrics.d.ts.map +1 -0
  730. package/dist/tools/metrics.js +28 -0
  731. package/dist/tools/metrics.js.map +1 -0
  732. package/dist/tools/open-editor.d.ts +10 -0
  733. package/dist/tools/open-editor.d.ts.map +1 -0
  734. package/dist/tools/open-editor.js +62 -0
  735. package/dist/tools/open-editor.js.map +1 -0
  736. package/dist/tools/preview.d.ts +12 -0
  737. package/dist/tools/preview.d.ts.map +1 -0
  738. package/dist/tools/preview.js +104 -0
  739. package/dist/tools/preview.js.map +1 -0
  740. package/dist/tools/rename.d.ts +7 -0
  741. package/dist/tools/rename.d.ts.map +1 -0
  742. package/dist/tools/rename.js +39 -0
  743. package/dist/tools/rename.js.map +1 -0
  744. package/dist/tools/result.d.ts +12 -0
  745. package/dist/tools/result.d.ts.map +1 -0
  746. package/dist/tools/result.js +55 -0
  747. package/dist/tools/result.js.map +1 -0
  748. package/dist/tools/save.d.ts +19 -0
  749. package/dist/tools/save.d.ts.map +1 -0
  750. package/dist/tools/save.js +117 -0
  751. package/dist/tools/save.js.map +1 -0
  752. package/dist/viewer/broadcaster.d.ts +13 -0
  753. package/dist/viewer/broadcaster.d.ts.map +1 -0
  754. package/dist/viewer/broadcaster.js +44 -0
  755. package/dist/viewer/broadcaster.js.map +1 -0
  756. package/dist/viewer/index.d.ts +7 -0
  757. package/dist/viewer/index.d.ts.map +1 -0
  758. package/dist/viewer/index.js +7 -0
  759. package/dist/viewer/index.js.map +1 -0
  760. package/dist/viewer/listener.d.ts +16 -0
  761. package/dist/viewer/listener.d.ts.map +1 -0
  762. package/dist/viewer/listener.js +30 -0
  763. package/dist/viewer/listener.js.map +1 -0
  764. package/dist/viewer/presigned-r2-url-builder.d.ts +30 -0
  765. package/dist/viewer/presigned-r2-url-builder.d.ts.map +1 -0
  766. package/dist/viewer/presigned-r2-url-builder.js +40 -0
  767. package/dist/viewer/presigned-r2-url-builder.js.map +1 -0
  768. package/dist/viewer/resource-route.d.ts +9 -0
  769. package/dist/viewer/resource-route.d.ts.map +1 -0
  770. package/dist/viewer/resource-route.js +59 -0
  771. package/dist/viewer/resource-route.js.map +1 -0
  772. package/dist/viewer/router.d.ts +20 -0
  773. package/dist/viewer/router.d.ts.map +1 -0
  774. package/dist/viewer/router.js +142 -0
  775. package/dist/viewer/router.js.map +1 -0
  776. package/dist/viewer/session-mount.d.ts +10 -0
  777. package/dist/viewer/session-mount.d.ts.map +1 -0
  778. package/dist/viewer/session-mount.js +24 -0
  779. package/dist/viewer/session-mount.js.map +1 -0
  780. package/dist/viewer/spa-assets.generated.d.ts +2 -0
  781. package/dist/viewer/spa-assets.generated.d.ts.map +1 -0
  782. package/dist/viewer/spa-assets.generated.js +989 -0
  783. package/dist/viewer/spa-assets.generated.js.map +1 -0
  784. package/dist/viewer/url-builder.d.ts +48 -0
  785. package/dist/viewer/url-builder.d.ts.map +1 -0
  786. package/dist/viewer/url-builder.js +38 -0
  787. package/dist/viewer/url-builder.js.map +1 -0
  788. package/dist/workspace/hosted-stub.d.ts +28 -0
  789. package/dist/workspace/hosted-stub.d.ts.map +1 -0
  790. package/dist/workspace/hosted-stub.js +44 -0
  791. package/dist/workspace/hosted-stub.js.map +1 -0
  792. package/dist/workspace/in-memory.d.ts +23 -0
  793. package/dist/workspace/in-memory.d.ts.map +1 -0
  794. package/dist/workspace/in-memory.js +161 -0
  795. package/dist/workspace/in-memory.js.map +1 -0
  796. package/dist/workspace/index.d.ts +6 -0
  797. package/dist/workspace/index.d.ts.map +1 -0
  798. package/dist/workspace/index.js +6 -0
  799. package/dist/workspace/index.js.map +1 -0
  800. package/dist/workspace/node-fs.d.ts +23 -0
  801. package/dist/workspace/node-fs.d.ts.map +1 -0
  802. package/dist/workspace/node-fs.js +90 -0
  803. package/dist/workspace/node-fs.js.map +1 -0
  804. package/dist/workspace/s3.d.ts +32 -0
  805. package/dist/workspace/s3.d.ts.map +1 -0
  806. package/dist/workspace/s3.js +191 -0
  807. package/dist/workspace/s3.js.map +1 -0
  808. package/dist/workspace/scoped.d.ts +32 -0
  809. package/dist/workspace/scoped.d.ts.map +1 -0
  810. package/dist/workspace/scoped.js +76 -0
  811. package/dist/workspace/scoped.js.map +1 -0
  812. package/dist/workspace/types.d.ts +75 -0
  813. package/dist/workspace/types.d.ts.map +1 -0
  814. package/dist/workspace/types.js +18 -0
  815. package/dist/workspace/types.js.map +1 -0
  816. package/package.json +80 -0
@@ -0,0 +1,1045 @@
1
+ > This is one page of the CE.SDK Vanilla JS/TS documentation. For a complete overview, see the [Vanilla JS/TS Documentation Index](https://img.ly/docs/cesdk/js.md). For all docs in one file, see [llms-full.txt](./llms-full.txt.md).
2
+
3
+ **Navigation:** [Guides](./guides.md) > [AI Integration](./user-interface/ai-integration.md) > [IMG.LY AI Gateway](./user-interface/ai-integration/gateway-provider.md) > [Plugins](./plugins.md) > [AI: IMG.LY AI Gateway](./user-interface/ai-integration/gateway-provider.md)
4
+
5
+ ---
6
+
7
+ Connect CE.SDK to AI models for image, video, text, and audio generation through the IMG.LY AI Gateway.
8
+
9
+ ![AI Generation with the IMG.LY AI Gateway](https://img.ly/docs/cesdk/./assets/browser.hero.webp)
10
+
11
+ > **Reading time:** 10 minutes
12
+ >
13
+ > **Resources:**
14
+ >
15
+ > - [Download examples](https://github.com/imgly/cesdk-web-examples/archive/refs/tags/release-$UBQ_VERSION$.zip)
16
+ > - [View source on GitHub](https://github.com/imgly/cesdk-web-examples/tree/release-$UBQ_VERSION$/guides-user-interface-ai-integration-gateway-provider-browser)
17
+ > - [Open in StackBlitz](https://stackblitz.com/github/imgly/cesdk-web-examples/tree/v$UBQ_VERSION$/guides-user-interface-ai-integration-gateway-provider-browser)
18
+ > - [Live demo](https://img.ly/docs/cesdk/examples/guides-user-interface-ai-integration-gateway-provider-browser/)
19
+
20
+ The IMG.LY AI Gateway is a managed API service that sits between CE.SDK and upstream AI providers. Instead of configuring each provider separately with proxy URLs and API keys, we point all generation requests at a single gateway URL. The gateway handles model routing, authentication, billing, and credit management. Each content type has a dedicated `GatewayProvider` factory that fetches the model's OpenAPI schema and renders input fields automatically.
21
+
22
+ ```typescript file=@cesdk_web_examples/guides-user-interface-ai-integration-gateway-provider-browser/browser.ts reference-only
23
+ import type { EditorPlugin, EditorPluginContext } from '@cesdk/cesdk-js';
24
+
25
+ import {
26
+ BlurAssetSource,
27
+ ColorPaletteAssetSource,
28
+ CropPresetsAssetSource,
29
+ DemoAssetSources,
30
+ EffectsAssetSource,
31
+ FiltersAssetSource,
32
+ PagePresetsAssetSource,
33
+ StickerAssetSource,
34
+ TextAssetSource,
35
+ TextComponentAssetSource,
36
+ TypefaceAssetSource,
37
+ UploadAssetSources,
38
+ VectorShapeAssetSource
39
+ } from '@cesdk/cesdk-js/plugins';
40
+ import { DesignEditorConfig } from './design-editor/plugin';
41
+ import ImageGeneration from '@imgly/plugin-ai-image-generation-web';
42
+ import { GatewayProvider as ImageGatewayProvider } from '@imgly/plugin-ai-image-generation-web/gateway';
43
+ import TextGeneration from '@imgly/plugin-ai-text-generation-web';
44
+ import { GatewayProvider as TextGatewayProvider } from '@imgly/plugin-ai-text-generation-web/gateway';
45
+ import VideoGeneration from '@imgly/plugin-ai-video-generation-web';
46
+ import { GatewayProvider as VideoGatewayProvider } from '@imgly/plugin-ai-video-generation-web/gateway';
47
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
48
+ import { GatewayProvider as AudioGatewayProvider } from '@imgly/plugin-ai-audio-generation-web/gateway';
49
+ import packageJson from './package.json';
50
+
51
+ class Example implements EditorPlugin {
52
+ name = packageJson.name;
53
+ version = packageJson.version;
54
+
55
+ async initialize({ cesdk }: EditorPluginContext): Promise<void> {
56
+ if (!cesdk) {
57
+ throw new Error('CE.SDK instance is required for this plugin');
58
+ }
59
+
60
+ await cesdk.addPlugin(new DesignEditorConfig());
61
+
62
+ // Add asset source plugins
63
+ await cesdk.addPlugin(new BlurAssetSource());
64
+ await cesdk.addPlugin(new ColorPaletteAssetSource());
65
+ await cesdk.addPlugin(new CropPresetsAssetSource());
66
+ await cesdk.addPlugin(
67
+ new UploadAssetSources({ include: ['ly.img.image.upload'] })
68
+ );
69
+ await cesdk.addPlugin(
70
+ new DemoAssetSources({
71
+ include: [
72
+ 'ly.img.templates.blank.*',
73
+ 'ly.img.templates.presentation.*',
74
+ 'ly.img.templates.print.*',
75
+ 'ly.img.templates.social.*',
76
+ 'ly.img.image.*'
77
+ ]
78
+ })
79
+ );
80
+ await cesdk.addPlugin(new EffectsAssetSource());
81
+ await cesdk.addPlugin(new FiltersAssetSource());
82
+ await cesdk.addPlugin(new PagePresetsAssetSource());
83
+ await cesdk.addPlugin(new StickerAssetSource());
84
+ await cesdk.addPlugin(new TextAssetSource());
85
+ await cesdk.addPlugin(new TextComponentAssetSource());
86
+ await cesdk.addPlugin(new TypefaceAssetSource());
87
+ await cesdk.addPlugin(new VectorShapeAssetSource());
88
+
89
+ await cesdk.actions.run('scene.create', {
90
+ page: {
91
+ sourceId: 'ly.img.page.presets',
92
+ assetId: 'ly.img.page.presets.print.iso.a6.landscape'
93
+ }
94
+ });
95
+
96
+ // Register a token action that CE.SDK calls before each generation request.
97
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
98
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
99
+ const res = await fetch('/api/ai/token', { method: 'POST' });
100
+ const { token } = await res.json();
101
+ return token;
102
+ });
103
+
104
+ // Alternative: use a direct API key for development (not for production)
105
+ /*
106
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
107
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
108
+ });
109
+ */
110
+
111
+ // All gateway providers share this configuration.
112
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
113
+ const gatewayConfig = {
114
+ debug: true
115
+ };
116
+
117
+ // Configure image generation with text-to-image and image-to-image providers
118
+ await cesdk.addPlugin(
119
+ ImageGeneration({
120
+ providers: {
121
+ text2image: ImageGatewayProvider('bfl/flux-2', gatewayConfig),
122
+ image2image: ImageGatewayProvider('bfl/flux-2-edit', gatewayConfig)
123
+ }
124
+ })
125
+ );
126
+
127
+ // Configure text generation with streaming output
128
+ await cesdk.addPlugin(
129
+ TextGeneration({
130
+ providers: {
131
+ text2text: TextGatewayProvider('openai/gpt-5.4-mini', gatewayConfig)
132
+ }
133
+ })
134
+ );
135
+
136
+ // Configure video generation with text-to-video and image-to-video providers
137
+ await cesdk.addPlugin(
138
+ VideoGeneration({
139
+ providers: {
140
+ text2video: VideoGatewayProvider(
141
+ 'google/veo-3.1-fast',
142
+ gatewayConfig
143
+ ),
144
+ image2video: VideoGatewayProvider(
145
+ 'google/veo-3.1-fast-i2v',
146
+ gatewayConfig
147
+ )
148
+ }
149
+ })
150
+ );
151
+
152
+ // Configure audio generation with text-to-speech
153
+ await cesdk.addPlugin(
154
+ AudioGeneration({
155
+ providers: {
156
+ text2speech: AudioGatewayProvider(
157
+ 'elevenlabs/eleven-v3-tts',
158
+ gatewayConfig
159
+ )
160
+ }
161
+ })
162
+ );
163
+
164
+ // Alternative: discover available models from the gateway and wire them
165
+ // into providers by capability. Only models the API key's scopes permit
166
+ // appear in the response.
167
+ /*
168
+ type GatewayModel = {
169
+ id: string;
170
+ name: string;
171
+ creator: string;
172
+ capability: string;
173
+ };
174
+ type ModelsByCapability = Partial<Record<string, GatewayModel[]>>;
175
+
176
+ // Mint a short-lived JWT via the backend token endpoint (see highlight-token-action)
177
+ const tokenRes = await fetch('/api/ai/token', { method: 'POST' });
178
+ const { token } = await tokenRes.json();
179
+
180
+ // GET /v1/models returns a flat array; ?groupBy=capability returns an object
181
+ // keyed by capability (text2image, image2image, text2text, text2video,
182
+ // image2video, text2speech, speech2text).
183
+ const modelsRes = await fetch(
184
+ 'https://gateway.img.ly/v1/models?groupBy=capability',
185
+ { headers: { Authorization: `Bearer ${token}` } }
186
+ );
187
+ const modelsByCapability: ModelsByCapability = await modelsRes.json();
188
+
189
+ await cesdk.addPlugin(
190
+ ImageGeneration({
191
+ providers: {
192
+ text2image: modelsByCapability.text2image?.map((model) =>
193
+ ImageGatewayProvider(model.id, gatewayConfig)
194
+ ),
195
+ image2image: modelsByCapability.image2image?.map((model) =>
196
+ ImageGatewayProvider(model.id, gatewayConfig)
197
+ )
198
+ }
199
+ })
200
+ );
201
+
202
+ await cesdk.addPlugin(
203
+ VideoGeneration({
204
+ providers: {
205
+ text2video: modelsByCapability.text2video?.map((model) =>
206
+ VideoGatewayProvider(model.id, gatewayConfig)
207
+ ),
208
+ image2video: modelsByCapability.image2video?.map((model) =>
209
+ VideoGatewayProvider(model.id, gatewayConfig)
210
+ )
211
+ }
212
+ })
213
+ );
214
+
215
+ await cesdk.addPlugin(
216
+ TextGeneration({
217
+ providers: {
218
+ text2text: modelsByCapability.text2text?.map((model) =>
219
+ TextGatewayProvider(model.id, gatewayConfig)
220
+ )
221
+ }
222
+ })
223
+ );
224
+
225
+ await cesdk.addPlugin(
226
+ AudioGeneration({
227
+ providers: {
228
+ text2speech: modelsByCapability.text2speech?.map((model) =>
229
+ AudioGatewayProvider(model.id, gatewayConfig)
230
+ )
231
+ }
232
+ })
233
+ );
234
+ */
235
+
236
+ // You can also pass arrays of providers to offer model selection in the UI
237
+ /*
238
+ await cesdk.addPlugin(
239
+ ImageGeneration({
240
+ providers: {
241
+ text2image: [
242
+ ImageGatewayProvider('bfl/flux-2', gatewayConfig),
243
+ ImageGatewayProvider('google/nano-banana-pro', gatewayConfig)
244
+ ]
245
+ }
246
+ })
247
+ );
248
+ */
249
+
250
+ // Customize provider labels in the UI
251
+ /*
252
+ cesdk.i18n.setTranslations({
253
+ en: {
254
+ 'ly.img.plugin-ai-image-generation-web.gateway/bfl/flux-2.defaults.property.prompt':
255
+ 'Describe your image',
256
+ },
257
+ });
258
+ */
259
+
260
+ // Route generated assets through your own storage so scenes outlive
261
+ // the short-lived gateway URL. The middleware rewrites the output URL
262
+ // before CE.SDK wires it into a block fill.
263
+ /*
264
+ import { uploadMiddleware } from '@imgly/plugin-ai-generation-web';
265
+
266
+ async function uploadToYourStorageServer(assetUrl: string): Promise<string> {
267
+ // Replace with your actual storage API call
268
+ const response = await fetch('https://your-server.com/api/store', {
269
+ method: 'POST',
270
+ headers: { 'Content-Type': 'application/json' },
271
+ body: JSON.stringify({ url: assetUrl })
272
+ });
273
+ const { permanentUrl } = await response.json();
274
+ return permanentUrl;
275
+ }
276
+
277
+ await cesdk.addPlugin(
278
+ ImageGeneration({
279
+ providers: {
280
+ text2image: ImageGatewayProvider('bfl/flux-2', {
281
+ ...gatewayConfig,
282
+ middlewares: [
283
+ uploadMiddleware(async (output) => ({
284
+ ...output,
285
+ url: await uploadToYourStorageServer(output.url)
286
+ }))
287
+ ]
288
+ })
289
+ }
290
+ })
291
+ );
292
+ */
293
+ }
294
+ }
295
+
296
+ export default Example;
297
+ ```
298
+
299
+ This guide covers obtaining an API key, setting up token-based authentication, configuring gateway providers for each content type (image, text, video, audio), and customizing provider behavior.
300
+
301
+ ## Prerequisites
302
+
303
+ Before setting up gateway providers, you need:
304
+
305
+ - CE.SDK with the relevant AI generation plugin packages installed
306
+ - An IMG.LY account with a gateway API key from the [Dashboard](https://img.ly/dashboard)
307
+ - For production: a backend endpoint that mints short-lived JWT tokens
308
+
309
+ ## Obtaining an API Key
310
+
311
+ We create and manage API keys in the IMG.LY Dashboard. Keys use the `sk_` prefix and control which AI models and services your application can access. You configure model access scopes and credit budgets per key in the Dashboard.
312
+
313
+ ## Authentication
314
+
315
+ The gateway uses token-based authentication. Your API key (`sk_...`) should never be exposed in client-side code. Instead, we implement a token endpoint on your server that mints short-lived JWT tokens by calling the gateway's `POST /v1/tokens` endpoint. CE.SDK retrieves these tokens through a registered action.
316
+
317
+ ### Backend Token Endpoint (Production)
318
+
319
+ The token endpoint drops into any existing backend with minimal effort. The handler does one thing: forward a `POST /v1/tokens` request to the gateway with our API key in the `Authorization` header and return the minted JWT to the client. No SDK, no database, no state — a single HTTP call. Optionally pass a `sub` claim to identify the end user for per-user rate limiting.
320
+
321
+ The example below uses Express, but the same pattern works in any HTTP framework or language — Fastify, Hono, Next.js route handlers, FastAPI, Rails, Go's `net/http`, ASP.NET, and so on. The only requirement is the ability to make an outbound HTTP request and keep the API key out of client-side code.
322
+
323
+ ```typescript
324
+ // Express — any backend framework or language works the same way
325
+ app.post('/api/ai/token', async (req, res) => {
326
+ const response = await fetch('https://gateway.img.ly/v1/tokens', {
327
+ method: 'POST',
328
+ headers: {
329
+ Authorization: `Bearer ${process.env.IMGLY_API_KEY}`,
330
+ 'Content-Type': 'application/json'
331
+ },
332
+ body: JSON.stringify({ sub: req.user?.id })
333
+ });
334
+ const { token } = await response.json();
335
+ res.json({ token });
336
+ });
337
+ ```
338
+
339
+ On the frontend, we register a token action that CE.SDK calls automatically before each generation request. Tokens are cached for 5 minutes by default (configurable via `tokenCacheTTL`).
340
+
341
+ ```typescript highlight-token-action
342
+ // Register a token action that CE.SDK calls before each generation request.
343
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
344
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
345
+ const res = await fetch('/api/ai/token', { method: 'POST' });
346
+ const { token } = await res.json();
347
+ return token;
348
+ });
349
+ ```
350
+
351
+ ### Direct API Key (Development and Internal Tools)
352
+
353
+ For local development or internal tools where all users are trusted, we can pass the API key directly. The key is visible in DevTools, so do not use this approach in public-facing applications.
354
+
355
+ We return `{ dangerouslyExposeApiKey: 'sk_...' }` from the token action. CE.SDK rejects raw `sk_` strings — the wrapper object makes the security trade-off explicit. Manage exposure via key scopes and credit budgets in the Dashboard.
356
+
357
+ ```typescript highlight-direct-api-key
358
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
359
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
360
+ });
361
+ ```
362
+
363
+ ## Gateway Provider Configuration
364
+
365
+ All gateway providers share a `GatewayProviderConfiguration` object. An empty object is sufficient in most cases — the gateway URL and token action ID have sensible defaults.
366
+
367
+ ```typescript highlight-gateway-config
368
+ // All gateway providers share this configuration.
369
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
370
+ const gatewayConfig = {
371
+ debug: true
372
+ };
373
+ ```
374
+
375
+ The available configuration options are:
376
+
377
+ - **`gatewayUrl`**: Base URL of the gateway service. Defaults to `'https://gateway.img.ly'`.
378
+ - **`history`**: Where generated assets are stored. Defaults to `'@imgly/indexedDB'`. Set to `'@imgly/local'` for in-memory storage or `false` to disable.
379
+ - **`tokenActionId`**: Action ID for token retrieval. Defaults to `'ly.img.ai.getToken'`.
380
+ - **`tokenCacheTTL`**: Token cache duration in milliseconds. Defaults to `300000` (5 minutes).
381
+ - **`middlewares`**: Middleware functions that wrap the generation call. See [Middleware](#middleware).
382
+ - **`onError`**: Called when schema loading or provider initialization fails.
383
+ - **`supportedQuickActions`**: Enable or disable individual quick actions on the gateway model. Map a quick-action ID to `false` to disable it, or `true` to keep the default. Omitted IDs keep their defaults.
384
+ - **`debug`**: Enable console logging for troubleshooting.
385
+
386
+ ## Middleware
387
+
388
+ Gateway providers accept the shared `middlewares` option that every other AI provider exposes. Hook into generation for logging, rate limiting, custom error handling, or persisting outputs to your own storage.
389
+
390
+ The most common use case is solving the short-lived URL problem described in [Asset URL Lifetime](#asset-url-lifetime): `uploadMiddleware` runs after generation completes and rewrites the returned URL, so CE.SDK sets the block fill from your persistent copy rather than the ephemeral gateway URL.
391
+
392
+ ```typescript highlight-upload-middleware
393
+ import { uploadMiddleware } from '@imgly/plugin-ai-generation-web';
394
+
395
+ async function uploadToYourStorageServer(assetUrl: string): Promise<string> {
396
+ // Replace with your actual storage API call
397
+ const response = await fetch('https://your-server.com/api/store', {
398
+ method: 'POST',
399
+ headers: { 'Content-Type': 'application/json' },
400
+ body: JSON.stringify({ url: assetUrl })
401
+ });
402
+ const { permanentUrl } = await response.json();
403
+ return permanentUrl;
404
+ }
405
+
406
+ await cesdk.addPlugin(
407
+ ImageGeneration({
408
+ providers: {
409
+ text2image: ImageGatewayProvider('bfl/flux-2', {
410
+ ...gatewayConfig,
411
+ middlewares: [
412
+ uploadMiddleware(async (output) => ({
413
+ ...output,
414
+ url: await uploadToYourStorageServer(output.url)
415
+ }))
416
+ ]
417
+ })
418
+ }
419
+ })
420
+ );
421
+ ```
422
+
423
+ See [Integrate AI Features → Using Middleware](./user-interface/ai-integration/integrate.md) for the available middlewares, ordering semantics, and end-to-end examples.
424
+
425
+ ## Asset URL Lifetime
426
+
427
+ Output URLs the gateway returns for generated images, videos, and audio are short-lived presigned URLs. They are meant for immediate consumption — the plugin wires each URL into a block fill as soon as generation completes. Fetching the URL after its TTL elapses will fail, and any scene that still references it will render broken.
428
+
429
+ The `history` option on `GatewayProviderConfiguration` softens this in the same browser:
430
+
431
+ - `'@imgly/indexedDB'` (default): the plugin downloads each generated asset into the browser's IndexedDB. History-source lookups keep working after the gateway URL expires, but only in the browser that generated the asset.
432
+ - `'@imgly/local'`: metadata only — history entries break once the gateway URL expires.
433
+ - `false`: no history persistence.
434
+
435
+ IndexedDB persistence does not rewrite block fills that were set from the ephemeral URL — the block still points at the original gateway URL. Scenes that need to outlive the TTL or travel between sessions and browsers should re-upload generated outputs to their own storage via [Middleware](#middleware) (`uploadMiddleware`) before the URL is wired into the block.
436
+
437
+ ## Setting Up Image Generation
438
+
439
+ We import `GatewayProvider` from `@imgly/plugin-ai-image-generation-web/gateway` and the default export from `@imgly/plugin-ai-image-generation-web`. We create providers via `GatewayProvider(modelId, config)` for text-to-image and image-to-image models.
440
+
441
+ The image provider fetches the model schema, renders input fields, uploads local blob/buffer URLs, and creates placeholder blocks that fill with the generated result.
442
+
443
+ ```typescript highlight-image-generation
444
+ import ImageGeneration from '@imgly/plugin-ai-image-generation-web';
445
+ import { GatewayProvider as ImageGatewayProvider } from '@imgly/plugin-ai-image-generation-web/gateway';
446
+ import TextGeneration from '@imgly/plugin-ai-text-generation-web';
447
+ import { GatewayProvider as TextGatewayProvider } from '@imgly/plugin-ai-text-generation-web/gateway';
448
+ import VideoGeneration from '@imgly/plugin-ai-video-generation-web';
449
+ import { GatewayProvider as VideoGatewayProvider } from '@imgly/plugin-ai-video-generation-web/gateway';
450
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
451
+ import { GatewayProvider as AudioGatewayProvider } from '@imgly/plugin-ai-audio-generation-web/gateway';
452
+ import packageJson from './package.json';
453
+
454
+ class Example implements EditorPlugin {
455
+ name = packageJson.name;
456
+ version = packageJson.version;
457
+
458
+ async initialize({ cesdk }: EditorPluginContext): Promise<void> {
459
+ if (!cesdk) {
460
+ throw new Error('CE.SDK instance is required for this plugin');
461
+ }
462
+
463
+ await cesdk.addPlugin(new DesignEditorConfig());
464
+
465
+ // Add asset source plugins
466
+ await cesdk.addPlugin(new BlurAssetSource());
467
+ await cesdk.addPlugin(new ColorPaletteAssetSource());
468
+ await cesdk.addPlugin(new CropPresetsAssetSource());
469
+ await cesdk.addPlugin(
470
+ new UploadAssetSources({ include: ['ly.img.image.upload'] })
471
+ );
472
+ await cesdk.addPlugin(
473
+ new DemoAssetSources({
474
+ include: [
475
+ 'ly.img.templates.blank.*',
476
+ 'ly.img.templates.presentation.*',
477
+ 'ly.img.templates.print.*',
478
+ 'ly.img.templates.social.*',
479
+ 'ly.img.image.*'
480
+ ]
481
+ })
482
+ );
483
+ await cesdk.addPlugin(new EffectsAssetSource());
484
+ await cesdk.addPlugin(new FiltersAssetSource());
485
+ await cesdk.addPlugin(new PagePresetsAssetSource());
486
+ await cesdk.addPlugin(new StickerAssetSource());
487
+ await cesdk.addPlugin(new TextAssetSource());
488
+ await cesdk.addPlugin(new TextComponentAssetSource());
489
+ await cesdk.addPlugin(new TypefaceAssetSource());
490
+ await cesdk.addPlugin(new VectorShapeAssetSource());
491
+
492
+ await cesdk.actions.run('scene.create', {
493
+ page: {
494
+ sourceId: 'ly.img.page.presets',
495
+ assetId: 'ly.img.page.presets.print.iso.a6.landscape'
496
+ }
497
+ });
498
+
499
+ // Register a token action that CE.SDK calls before each generation request.
500
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
501
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
502
+ const res = await fetch('/api/ai/token', { method: 'POST' });
503
+ const { token } = await res.json();
504
+ return token;
505
+ });
506
+
507
+ // Alternative: use a direct API key for development (not for production)
508
+ /*
509
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
510
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
511
+ });
512
+ */
513
+
514
+ // All gateway providers share this configuration.
515
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
516
+ const gatewayConfig = {
517
+ debug: true
518
+ };
519
+
520
+ // Configure image generation with text-to-image and image-to-image providers
521
+ await cesdk.addPlugin(
522
+ ImageGeneration({
523
+ providers: {
524
+ text2image: ImageGatewayProvider('bfl/flux-2', gatewayConfig),
525
+ image2image: ImageGatewayProvider('bfl/flux-2-edit', gatewayConfig)
526
+ }
527
+ })
528
+ );
529
+ ```
530
+
531
+ ## Setting Up Text Generation
532
+
533
+ We import `GatewayProvider` from `@imgly/plugin-ai-text-generation-web/gateway` and register it under `providers.text2text`. The text provider streams responses via SSE delta events and applies them to text blocks in real time. It maps `prompt` input to `messages: [{ role: 'user', content: prompt }]` automatically.
534
+
535
+ ```typescript highlight-text-generation
536
+ import TextGeneration from '@imgly/plugin-ai-text-generation-web';
537
+ import { GatewayProvider as TextGatewayProvider } from '@imgly/plugin-ai-text-generation-web/gateway';
538
+ import VideoGeneration from '@imgly/plugin-ai-video-generation-web';
539
+ import { GatewayProvider as VideoGatewayProvider } from '@imgly/plugin-ai-video-generation-web/gateway';
540
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
541
+ import { GatewayProvider as AudioGatewayProvider } from '@imgly/plugin-ai-audio-generation-web/gateway';
542
+ import packageJson from './package.json';
543
+
544
+ class Example implements EditorPlugin {
545
+ name = packageJson.name;
546
+ version = packageJson.version;
547
+
548
+ async initialize({ cesdk }: EditorPluginContext): Promise<void> {
549
+ if (!cesdk) {
550
+ throw new Error('CE.SDK instance is required for this plugin');
551
+ }
552
+
553
+ await cesdk.addPlugin(new DesignEditorConfig());
554
+
555
+ // Add asset source plugins
556
+ await cesdk.addPlugin(new BlurAssetSource());
557
+ await cesdk.addPlugin(new ColorPaletteAssetSource());
558
+ await cesdk.addPlugin(new CropPresetsAssetSource());
559
+ await cesdk.addPlugin(
560
+ new UploadAssetSources({ include: ['ly.img.image.upload'] })
561
+ );
562
+ await cesdk.addPlugin(
563
+ new DemoAssetSources({
564
+ include: [
565
+ 'ly.img.templates.blank.*',
566
+ 'ly.img.templates.presentation.*',
567
+ 'ly.img.templates.print.*',
568
+ 'ly.img.templates.social.*',
569
+ 'ly.img.image.*'
570
+ ]
571
+ })
572
+ );
573
+ await cesdk.addPlugin(new EffectsAssetSource());
574
+ await cesdk.addPlugin(new FiltersAssetSource());
575
+ await cesdk.addPlugin(new PagePresetsAssetSource());
576
+ await cesdk.addPlugin(new StickerAssetSource());
577
+ await cesdk.addPlugin(new TextAssetSource());
578
+ await cesdk.addPlugin(new TextComponentAssetSource());
579
+ await cesdk.addPlugin(new TypefaceAssetSource());
580
+ await cesdk.addPlugin(new VectorShapeAssetSource());
581
+
582
+ await cesdk.actions.run('scene.create', {
583
+ page: {
584
+ sourceId: 'ly.img.page.presets',
585
+ assetId: 'ly.img.page.presets.print.iso.a6.landscape'
586
+ }
587
+ });
588
+
589
+ // Register a token action that CE.SDK calls before each generation request.
590
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
591
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
592
+ const res = await fetch('/api/ai/token', { method: 'POST' });
593
+ const { token } = await res.json();
594
+ return token;
595
+ });
596
+
597
+ // Alternative: use a direct API key for development (not for production)
598
+ /*
599
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
600
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
601
+ });
602
+ */
603
+
604
+ // All gateway providers share this configuration.
605
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
606
+ const gatewayConfig = {
607
+ debug: true
608
+ };
609
+
610
+ // Configure image generation with text-to-image and image-to-image providers
611
+ await cesdk.addPlugin(
612
+ ImageGeneration({
613
+ providers: {
614
+ text2image: ImageGatewayProvider('bfl/flux-2', gatewayConfig),
615
+ image2image: ImageGatewayProvider('bfl/flux-2-edit', gatewayConfig)
616
+ }
617
+ })
618
+ );
619
+
620
+ // Configure text generation with streaming output
621
+ await cesdk.addPlugin(
622
+ TextGeneration({
623
+ providers: {
624
+ text2text: TextGatewayProvider('openai/gpt-5.4-mini', gatewayConfig)
625
+ }
626
+ })
627
+ );
628
+ ```
629
+
630
+ ## Setting Up Video Generation
631
+
632
+ We import `GatewayProvider` from `@imgly/plugin-ai-video-generation-web/gateway`. We create providers for text-to-video and image-to-video models. The video provider handles local image uploads, aspect ratio matching, and duration parsing.
633
+
634
+ ```typescript highlight-video-generation
635
+ import VideoGeneration from '@imgly/plugin-ai-video-generation-web';
636
+ import { GatewayProvider as VideoGatewayProvider } from '@imgly/plugin-ai-video-generation-web/gateway';
637
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
638
+ import { GatewayProvider as AudioGatewayProvider } from '@imgly/plugin-ai-audio-generation-web/gateway';
639
+ import packageJson from './package.json';
640
+
641
+ class Example implements EditorPlugin {
642
+ name = packageJson.name;
643
+ version = packageJson.version;
644
+
645
+ async initialize({ cesdk }: EditorPluginContext): Promise<void> {
646
+ if (!cesdk) {
647
+ throw new Error('CE.SDK instance is required for this plugin');
648
+ }
649
+
650
+ await cesdk.addPlugin(new DesignEditorConfig());
651
+
652
+ // Add asset source plugins
653
+ await cesdk.addPlugin(new BlurAssetSource());
654
+ await cesdk.addPlugin(new ColorPaletteAssetSource());
655
+ await cesdk.addPlugin(new CropPresetsAssetSource());
656
+ await cesdk.addPlugin(
657
+ new UploadAssetSources({ include: ['ly.img.image.upload'] })
658
+ );
659
+ await cesdk.addPlugin(
660
+ new DemoAssetSources({
661
+ include: [
662
+ 'ly.img.templates.blank.*',
663
+ 'ly.img.templates.presentation.*',
664
+ 'ly.img.templates.print.*',
665
+ 'ly.img.templates.social.*',
666
+ 'ly.img.image.*'
667
+ ]
668
+ })
669
+ );
670
+ await cesdk.addPlugin(new EffectsAssetSource());
671
+ await cesdk.addPlugin(new FiltersAssetSource());
672
+ await cesdk.addPlugin(new PagePresetsAssetSource());
673
+ await cesdk.addPlugin(new StickerAssetSource());
674
+ await cesdk.addPlugin(new TextAssetSource());
675
+ await cesdk.addPlugin(new TextComponentAssetSource());
676
+ await cesdk.addPlugin(new TypefaceAssetSource());
677
+ await cesdk.addPlugin(new VectorShapeAssetSource());
678
+
679
+ await cesdk.actions.run('scene.create', {
680
+ page: {
681
+ sourceId: 'ly.img.page.presets',
682
+ assetId: 'ly.img.page.presets.print.iso.a6.landscape'
683
+ }
684
+ });
685
+
686
+ // Register a token action that CE.SDK calls before each generation request.
687
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
688
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
689
+ const res = await fetch('/api/ai/token', { method: 'POST' });
690
+ const { token } = await res.json();
691
+ return token;
692
+ });
693
+
694
+ // Alternative: use a direct API key for development (not for production)
695
+ /*
696
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
697
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
698
+ });
699
+ */
700
+
701
+ // All gateway providers share this configuration.
702
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
703
+ const gatewayConfig = {
704
+ debug: true
705
+ };
706
+
707
+ // Configure image generation with text-to-image and image-to-image providers
708
+ await cesdk.addPlugin(
709
+ ImageGeneration({
710
+ providers: {
711
+ text2image: ImageGatewayProvider('bfl/flux-2', gatewayConfig),
712
+ image2image: ImageGatewayProvider('bfl/flux-2-edit', gatewayConfig)
713
+ }
714
+ })
715
+ );
716
+
717
+ // Configure text generation with streaming output
718
+ await cesdk.addPlugin(
719
+ TextGeneration({
720
+ providers: {
721
+ text2text: TextGatewayProvider('openai/gpt-5.4-mini', gatewayConfig)
722
+ }
723
+ })
724
+ );
725
+
726
+ // Configure video generation with text-to-video and image-to-video providers
727
+ await cesdk.addPlugin(
728
+ VideoGeneration({
729
+ providers: {
730
+ text2video: VideoGatewayProvider(
731
+ 'google/veo-3.1-fast',
732
+ gatewayConfig
733
+ ),
734
+ image2video: VideoGatewayProvider(
735
+ 'google/veo-3.1-fast-i2v',
736
+ gatewayConfig
737
+ )
738
+ }
739
+ })
740
+ );
741
+ ```
742
+
743
+ ## Setting Up Audio Generation
744
+
745
+ We import `GatewayProvider` from `@imgly/plugin-ai-audio-generation-web/gateway`. The audio provider fetches the generated audio blob to derive duration and generates a waveform thumbnail.
746
+
747
+ ```typescript highlight-audio-generation
748
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
749
+ import { GatewayProvider as AudioGatewayProvider } from '@imgly/plugin-ai-audio-generation-web/gateway';
750
+ import packageJson from './package.json';
751
+
752
+ class Example implements EditorPlugin {
753
+ name = packageJson.name;
754
+ version = packageJson.version;
755
+
756
+ async initialize({ cesdk }: EditorPluginContext): Promise<void> {
757
+ if (!cesdk) {
758
+ throw new Error('CE.SDK instance is required for this plugin');
759
+ }
760
+
761
+ await cesdk.addPlugin(new DesignEditorConfig());
762
+
763
+ // Add asset source plugins
764
+ await cesdk.addPlugin(new BlurAssetSource());
765
+ await cesdk.addPlugin(new ColorPaletteAssetSource());
766
+ await cesdk.addPlugin(new CropPresetsAssetSource());
767
+ await cesdk.addPlugin(
768
+ new UploadAssetSources({ include: ['ly.img.image.upload'] })
769
+ );
770
+ await cesdk.addPlugin(
771
+ new DemoAssetSources({
772
+ include: [
773
+ 'ly.img.templates.blank.*',
774
+ 'ly.img.templates.presentation.*',
775
+ 'ly.img.templates.print.*',
776
+ 'ly.img.templates.social.*',
777
+ 'ly.img.image.*'
778
+ ]
779
+ })
780
+ );
781
+ await cesdk.addPlugin(new EffectsAssetSource());
782
+ await cesdk.addPlugin(new FiltersAssetSource());
783
+ await cesdk.addPlugin(new PagePresetsAssetSource());
784
+ await cesdk.addPlugin(new StickerAssetSource());
785
+ await cesdk.addPlugin(new TextAssetSource());
786
+ await cesdk.addPlugin(new TextComponentAssetSource());
787
+ await cesdk.addPlugin(new TypefaceAssetSource());
788
+ await cesdk.addPlugin(new VectorShapeAssetSource());
789
+
790
+ await cesdk.actions.run('scene.create', {
791
+ page: {
792
+ sourceId: 'ly.img.page.presets',
793
+ assetId: 'ly.img.page.presets.print.iso.a6.landscape'
794
+ }
795
+ });
796
+
797
+ // Register a token action that CE.SDK calls before each generation request.
798
+ // In production, this calls your backend endpoint to mint a short-lived JWT.
799
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
800
+ const res = await fetch('/api/ai/token', { method: 'POST' });
801
+ const { token } = await res.json();
802
+ return token;
803
+ });
804
+
805
+ // Alternative: use a direct API key for development (not for production)
806
+ /*
807
+ cesdk.actions.register('ly.img.ai.getToken', async () => {
808
+ return { dangerouslyExposeApiKey: 'sk_your_api_key' };
809
+ });
810
+ */
811
+
812
+ // All gateway providers share this configuration.
813
+ // An empty object uses sensible defaults (gateway URL, token action ID, etc.).
814
+ const gatewayConfig = {
815
+ debug: true
816
+ };
817
+
818
+ // Configure image generation with text-to-image and image-to-image providers
819
+ await cesdk.addPlugin(
820
+ ImageGeneration({
821
+ providers: {
822
+ text2image: ImageGatewayProvider('bfl/flux-2', gatewayConfig),
823
+ image2image: ImageGatewayProvider('bfl/flux-2-edit', gatewayConfig)
824
+ }
825
+ })
826
+ );
827
+
828
+ // Configure text generation with streaming output
829
+ await cesdk.addPlugin(
830
+ TextGeneration({
831
+ providers: {
832
+ text2text: TextGatewayProvider('openai/gpt-5.4-mini', gatewayConfig)
833
+ }
834
+ })
835
+ );
836
+
837
+ // Configure video generation with text-to-video and image-to-video providers
838
+ await cesdk.addPlugin(
839
+ VideoGeneration({
840
+ providers: {
841
+ text2video: VideoGatewayProvider(
842
+ 'google/veo-3.1-fast',
843
+ gatewayConfig
844
+ ),
845
+ image2video: VideoGatewayProvider(
846
+ 'google/veo-3.1-fast-i2v',
847
+ gatewayConfig
848
+ )
849
+ }
850
+ })
851
+ );
852
+
853
+ // Configure audio generation with text-to-speech
854
+ await cesdk.addPlugin(
855
+ AudioGeneration({
856
+ providers: {
857
+ text2speech: AudioGatewayProvider(
858
+ 'elevenlabs/eleven-v3-tts',
859
+ gatewayConfig
860
+ )
861
+ }
862
+ })
863
+ );
864
+ ```
865
+
866
+ ## Multiple Providers and Model Selection
867
+
868
+ When we configure arrays of providers for a content type, CE.SDK shows a model selection dropdown. Gateway and direct providers can be combined in the same plugin.
869
+
870
+ ```typescript highlight-multiple-providers
871
+ await cesdk.addPlugin(
872
+ ImageGeneration({
873
+ providers: {
874
+ text2image: [
875
+ ImageGatewayProvider('bfl/flux-2', gatewayConfig),
876
+ ImageGatewayProvider('google/nano-banana-pro', gatewayConfig)
877
+ ]
878
+ }
879
+ })
880
+ );
881
+ ```
882
+
883
+ ## Dynamic Model Discovery
884
+
885
+ We can also fetch available models from the gateway API and create providers dynamically instead of hard-coding model IDs. Only models that the API key's scopes permit appear in the response — we use this to keep the UI in sync with whatever we have provisioned in the Dashboard.
886
+
887
+ The gateway exposes two query shapes:
888
+
889
+ - `GET /v1/models` — flat array of all accessible models
890
+ - `GET /v1/models?groupBy=capability` — object keyed by capability
891
+
892
+ Both require a `Authorization: Bearer <token>` header. Each entry has the following shape:
893
+
894
+ ```json
895
+ {
896
+ "id": "bfl/flux-2",
897
+ "name": "FLUX.2",
898
+ "creator": "Black Forest Labs",
899
+ "capability": "text2image"
900
+ }
901
+ ```
902
+
903
+ Supported capabilities are `text2image`, `image2image`, `text2text`, `text2video`, `image2video`, `text2speech`, and `speech2text`. We fetch the grouped form, loop by capability, and instantiate the matching `GatewayProvider` for each `model.id`.
904
+
905
+ ```typescript highlight-dynamic-models
906
+ type GatewayModel = {
907
+ id: string;
908
+ name: string;
909
+ creator: string;
910
+ capability: string;
911
+ };
912
+ type ModelsByCapability = Partial<Record<string, GatewayModel[]>>;
913
+
914
+ // Mint a short-lived JWT via the backend token endpoint (see highlight-token-action)
915
+ const tokenRes = await fetch('/api/ai/token', { method: 'POST' });
916
+ const { token } = await tokenRes.json();
917
+
918
+ // GET /v1/models returns a flat array; ?groupBy=capability returns an object
919
+ // keyed by capability (text2image, image2image, text2text, text2video,
920
+ // image2video, text2speech, speech2text).
921
+ const modelsRes = await fetch(
922
+ 'https://gateway.img.ly/v1/models?groupBy=capability',
923
+ { headers: { Authorization: `Bearer ${token}` } }
924
+ );
925
+ const modelsByCapability: ModelsByCapability = await modelsRes.json();
926
+
927
+ await cesdk.addPlugin(
928
+ ImageGeneration({
929
+ providers: {
930
+ text2image: modelsByCapability.text2image?.map((model) =>
931
+ ImageGatewayProvider(model.id, gatewayConfig)
932
+ ),
933
+ image2image: modelsByCapability.image2image?.map((model) =>
934
+ ImageGatewayProvider(model.id, gatewayConfig)
935
+ )
936
+ }
937
+ })
938
+ );
939
+
940
+ await cesdk.addPlugin(
941
+ VideoGeneration({
942
+ providers: {
943
+ text2video: modelsByCapability.text2video?.map((model) =>
944
+ VideoGatewayProvider(model.id, gatewayConfig)
945
+ ),
946
+ image2video: modelsByCapability.image2video?.map((model) =>
947
+ VideoGatewayProvider(model.id, gatewayConfig)
948
+ )
949
+ }
950
+ })
951
+ );
952
+
953
+ await cesdk.addPlugin(
954
+ TextGeneration({
955
+ providers: {
956
+ text2text: modelsByCapability.text2text?.map((model) =>
957
+ TextGatewayProvider(model.id, gatewayConfig)
958
+ )
959
+ }
960
+ })
961
+ );
962
+
963
+ await cesdk.addPlugin(
964
+ AudioGeneration({
965
+ providers: {
966
+ text2speech: modelsByCapability.text2speech?.map((model) =>
967
+ AudioGatewayProvider(model.id, gatewayConfig)
968
+ )
969
+ }
970
+ })
971
+ );
972
+ ```
973
+
974
+ ## Customizing Labels and Translations
975
+
976
+ Gateway providers register translation keys using the pattern `ly.img.plugin-ai-{kind}-generation-web.gateway/{modelId}.defaults.property.{propertyId}`. We override these via `cesdk.i18n.setTranslations()` before plugin initialization.
977
+
978
+ ```typescript highlight-translations
979
+ cesdk.i18n.setTranslations({
980
+ en: {
981
+ 'ly.img.plugin-ai-image-generation-web.gateway/bfl/flux-2.defaults.property.prompt':
982
+ 'Describe your image'
983
+ }
984
+ });
985
+ ```
986
+
987
+ ## Troubleshooting
988
+
989
+ Common issues when configuring gateway providers:
990
+
991
+ **"returned a raw API key" error**: The token action returned a string starting with `sk_`. Either use the `{ dangerouslyExposeApiKey }` wrapper or implement a backend token endpoint.
992
+
993
+ **"returned an empty token string"**: The token action returned an empty string. Check your backend endpoint returns a valid JWT.
994
+
995
+ **Schema loading fails**: If using a custom `gatewayUrl`, verify it is correct and accessible. Check the `onError` callback for details.
996
+
997
+ **Generation returns 401**: The JWT has expired or the API key was revoked. Check the `tokenCacheTTL` setting and Dashboard key status.
998
+
999
+ **Model not available**: The API key's scopes may not include the requested model. Check scope configuration in the Dashboard.
1000
+
1001
+ **Local images not uploading**: The gateway provider uploads `blob:` and `buffer:` URLs automatically. Ensure the gateway URL supports the `/v1/uploads` endpoint.
1002
+
1003
+ **Credit errors**: Check your credit balance in the IMG.LY Dashboard. Credits are claimed before generation and released on failure.
1004
+
1005
+ **CORS errors**: The gateway must allow requests from your application's origin.
1006
+
1007
+ **Previously-generated assets appear broken after some time**: The gateway's output URLs are short-lived presigned URLs. Keep `history: '@imgly/indexedDB'` (default) for persistent history lookups in the same browser, or use `uploadMiddleware` to re-upload outputs to your own storage — see [Middleware](#middleware) and [Asset URL Lifetime](#asset-url-lifetime).
1008
+
1009
+ ## API Reference
1010
+
1011
+ | Method / Type | Category | Purpose |
1012
+ | ------------------------------ | -------- | -------------------------------------------------------------------- |
1013
+ | `GatewayProvider()` (image) | Provider | Create image generation provider for a gateway model |
1014
+ | `GatewayProvider()` (text) | Provider | Create text generation provider with streaming |
1015
+ | `GatewayProvider()` (video) | Provider | Create video generation provider for a gateway model |
1016
+ | `GatewayProvider()` (audio) | Provider | Create audio generation provider for a gateway model |
1017
+ | `createGatewayProvider()` | Core | Generic factory for building custom gateway providers |
1018
+ | `createGatewayClient()` | Core | Create a low-level HTTP client for the gateway API |
1019
+ | `GatewayProviderConfiguration` | Type | Configuration interface shared by all gateway providers |
1020
+ | `GatewayTokenActionResult` | Type | Return type for the token action (string or dangerouslyExposeApiKey) |
1021
+ | `ImageGeneration` | Plugin | Default export from `@imgly/plugin-ai-image-generation-web` |
1022
+ | `TextGeneration` | Plugin | Default export from `@imgly/plugin-ai-text-generation-web` |
1023
+ | `VideoGeneration` | Plugin | Default export from `@imgly/plugin-ai-video-generation-web` |
1024
+ | `AudioGeneration` | Plugin | Default export from `@imgly/plugin-ai-audio-generation-web` |
1025
+ | `cesdk.addPlugin()` | Plugin | Register a plugin with the editor |
1026
+ | `cesdk.actions.register()` | Action | Register a named action (used for token retrieval) |
1027
+ | `cesdk.i18n.setTranslations()` | I18n | Customize UI labels and translations |
1028
+
1029
+ ## Next Steps
1030
+
1031
+ - [Image Generation](./user-interface/ai-integration/image-generation.md) — Direct provider configuration for image models
1032
+ - [Text Generation](./user-interface/ai-integration/text-generation.md) — Direct provider configuration for text models
1033
+ - [Video Generation](./user-interface/ai-integration/video-generation.md) — Direct provider configuration for video models
1034
+ - [Audio Generation](./user-interface/ai-integration/audio-generation.md) — Direct provider configuration for audio models
1035
+ - [Custom Provider](./user-interface/ai-integration/custom-provider.md) — Build a provider from scratch using the core interface
1036
+ - [Integrate AI Features](./user-interface/ai-integration/integrate.md) — Overview of AI integration in CE.SDK
1037
+
1038
+ ---
1039
+
1040
+ ## More Resources
1041
+
1042
+ - **[Vanilla JS/TS Documentation Index](https://img.ly/docs/cesdk/js.md)** - Browse all Vanilla JS/TS documentation
1043
+ - **[Complete Documentation](./llms-full.txt.md)** - Full documentation in one file (for LLMs)
1044
+ - **[Web Documentation](./js.md)** - Interactive documentation with examples
1045
+ - **[Support](mailto:support@img.ly)** - Contact IMG.LY support