@widgetic/ui-sdk) puts Widgetic’s ready-made pieces in your own web page with a few lines of code. Your customers use them without leaving your product and without a Widgetic account.
The pieces
Each piece has a page of its own, with its options, its events and what is special about it: the File Browser, the Composition Editor, the Embed Editor, the Widget Creator and Workflows. This page covers what they have in common: installing the SDK, mounting a piece, tokens, how the pieces look, their language, the Content Security Policy and their versions.
- File Browser
- Composition Editor
- Embed Editor
- Widget Creator
- Workflows

The File Browser: a customer's folders and files, filters by kind of file, search and sorting, and a place to drop files to upload.
- They work only for a partner in good standing, with storage. A session is made only while your account is active and your own storage works (see Every session needs your own storage). While your account is paused or stopped by an unpaid invoice, the pieces already on your customers’ pages are refused too (see Account Status), and so they are once your partnership has ended, from the day after its last day (see Ending a Partnership).
- No API key in the browser. Your server keeps the key and makes a short-lived editor session for the customer who is on the page. The page only ever holds that session’s token, and it can reach only that customer’s content.
- Your page stays yours. A piece is drawn inside a shadow root: your CSS cannot restyle it and its CSS cannot touch your page. The SDK writes nothing to
<html>or<body>, sends nopostMessageand never clears your container. - Small. The SDK is a loader of about 30 KB. A piece is downloaded from Widgetic’s CDN when you mount it, and only then.
How it works
1
Your server makes an editor session
When the page opens, your server asks Widgetic for a session for the signed-in customer (
POST /v1/managed-users/{id}/editor-sessions, with your API key) and returns the token. See Editor Sessions.2
Your page gives the SDK a getToken function
getToken fetches that token from your server. The SDK calls it when the piece starts and again shortly before the token runs out.3
The SDK mounts the piece
It downloads the piece, draws it in your container, and the piece talks to the Widgetic API with the token and nothing else.
Install
@latest. Replace <version> with it; npm view @widgetic/ui-sdk version prints the newest one:
Mount a piece
Give the container a height: the piece fills it./widgetic-session is the endpoint of yours that makes the session (see A server endpoint for your page). It returns { token, expiresAt }.
Options
mountModule resolves with a handle once the piece is on screen:
Events
Every piece adds events of its own, and some say more in
ready and error: select for the File Browser, dirty and saved for the Composition Editor and the Embed Editor, canvasChanged, widgetPublished and limitReached for the Widget Creator, openWorkflow and showEmbedCode for Workflows. They are on the page of each piece.
Several pieces on one page
mountModule creates a WidgeticUI, mounts one piece with it and destroys it again when you unmount(). To mount several pieces, or to download one ahead of time, make the WidgeticUI yourself:
Make the pieces look like your product
A piece can wear your colours, the roundness of your corners and your typeface. The components and the layout stay Widgetic’s: only the look follows your design system. The words can follow your language too (see below). Each piece has a theme of its own, so the pieces can look the same or different.The settings
Your own
colors win over the preset’s. A primary of yours without a primaryForeground gets the white or the dark ink that reads better on it.
Writing a colour
#rrggbb, #rgb, rgb(11 107 203) and hsl(210 90% 41%) always work. A colour name or oklch() works in a browser that understands it. var(--brand) and currentColor are refused: the piece reads the colour when you give it and cannot look at your page’s variables from there, so read the value in your page and pass it in. Transparency is ignored. The piece warns in the console about a combination that is hard to read: your text under 4.5:1 against your background, or your primary colour (or the text on it) under 3:1.
A font your page does not load yet
A font can only be defined by the page itself, never from inside a piece. Give thehttps address of its stylesheet as stylesheetUrl and the piece adds one <link rel="stylesheet" data-widgetic-ui-font> to your <head>, once however many pieces use it. It stays after unmount(), like the font rules every piece adds. A font your page already loads needs no stylesheetUrl. Under a strict Content-Security-Policy, style-src has to allow the stylesheet’s host and font-src the font files (for Google Fonts, https://fonts.googleapis.com and https://fonts.gstatic.com).
Changing a look later
- A bare mode (
'dark',{ mode: 'dark' }) changes the mode and keeps the rest of the look. Settings replace the whole look. - Settings given in a mount call, or to
setThemeon a piece, are that piece’s own.ui.updateTheme(settings)does not take them away, and a page that changes a preset does not turn a dark piece light. A call that names a mode reaches every piece. ui.getTheme()tells you the page’s mode and settings.'system'stays'system'.- A theme that cannot be used is refused with the code
INVALID_THEME. The message names the setting and what to write instead, and nothing changes. When only the piece can tell (an unknown preset name, a colour it cannot read),ui.updateThemereports it in the console and the piece keeps its look, whilesetThemeand a mount call throw (the mount fails withMOUNT_FAILEDand leaves its container empty).
What a theme cannot do yet
- The Widget Creator takes a theme’s mode, neutral colours, brand colour and font, but not yet its corners. A dark
mode, or colours of your own forbackground,foreground,muted,mutedForegroundandborder, restyle its panels, toolbar, menus, dialogs and chat, and thefontapplies to all of its text. Every text of it stays readable in a dark look, for each built-in preset and for neutral colours of your own. Yourprimarycolour is the creator’s accent: the selected tool, the sliders, the buttons that act, the chat’s Send button and what is on them, darker under the pointer (lighter on a dark surface). The text and icons on an accent are yourprimaryForegroundwhen you give one, else white or a dark ink, whichever reads on your colour, so a light yellow gets dark text. Without aprimarythe accents are Widgetic’s own green and blue. The canvas board and the live widget previews stay light on purpose (they show the widget as your customers will see it), and the chat’s message bubbles keep their own light colours. The handles the canvas draws on its board, a few accents the creator sets in script and the colours of a status (the green of a published widget, the red of an error) do not take your brand colour, and most of its corners are Widgetic’s own, soradiuschanges very little of it. The console says what stays light when a creator gets a dark theme. The File Browser and the Composition Editor follow a dark theme. - No layout or icons. The components are Widgetic’s. The words of the File Browser, the Composition Editor, the Embed Editor, the Widget Creator and Workflows can be changed (see the next section).
- Colours the piece can read as they are. No CSS variables, gradients or images.
Show the pieces in the language of your customers
The File Browser, the Composition Editor, the Embed Editor, the Widget Creator and Workflows speak your customers’ language. 65 languages come with the File Browser, the Composition Editor, the Widget Creator and Workflows, solocale: 'pl' is enough to get their words in Polish. For a language that is not among them, and for the Embed Editor, which has no built-in words yet, you hand over the words yourself. Every word a piece shows is a message with a key. You hand over the words you want to say differently, and every key you leave out keeps the built-in words of the locale (English when it has none), so you can also add a language one screen at a time. The examples are the File Browser’s; The Composition Editor, The Embed Editor, The Widget Creator and The Workflows screen say what is different.
Languages that come with the pieces
65 languages are built in, for the File Browser, the Composition Editor, the Widget Creator and Workflows. When yourlocale is one of them, or a regional form of one, the piece downloads that language’s words as one small file from the same folder of the CDN as the piece itself, and its first paint is already in that language. Any other locale (en, af, a tag nobody wrote words for) downloads nothing and the words stay English: plural forms, dates and direction still follow locale. The Embed Editor has no built-in words yet, so its words stay English whatever the locale is, unless your messages say otherwise.
The 65 languages
The 65 languages
locale:
- Your
messageswin. The built-in words come first and yours replace them, key by key. - They are provisional. The built-in words are machine translations that no native speaker has read yet.
module.localePackStatus('de')says'provisional'(it says'reviewed'for a language a native speaker has read, andnullfor a tag with no words), andmodule.supportedLocaleslists the 65 tags. Tell the support team about a word that is wrong, with the piece, thelocaleand the message key. - How a number or a date is written comes from the browser. The words come with the piece, but the browser knows how a language writes numbers, dates and file sizes and which plural forms it has. A browser that has no data for a language writes them the English way, chooses only “one” and “other” for a plural, and the piece says so once in the console; the words are still the language’s. Chrome 158 has no data for Irish, Maltese, Albanian, Georgian, Armenian, Galician, Basque and Occitan; Safari and Firefox have not been checked.
- A file that cannot be downloaded is said once in the console, and the piece goes on in English.
Which keys there are
fileBrowser.module.defaultMessages is an object of every key and its English text: a few hundred messages, grouped by where the words appear (action., upload., dialog., preview. and so on). It always matches the version of the piece you load, and it is the list to hand to a translator.
Writing a message
A message is text.{name} is a value the File Browser puts in; a number is written the way the locale writes numbers. {count, plural, one {# file} other {# files}} picks the form that fits the number in your customer’s language: other is required, =0 {none} matches exactly 0, # is the number, and a language with more forms says so (Polish has one, few, many and other). \{, \}, \# and \\ write the character itself. A translation keeps the {names} of the English message, in any order, and cannot ask for a value the message is never given.
Checking your words
fileBrowser.module.checkMessages(messages) says what is wrong without showing anything: one sentence for each key that does not exist (with the nearest real one), value that is not text, message that does not parse, or {name} the message is never given. An empty list means every message will be used. Put it in a test of your page.
A message that cannot be used never breaks the screen: the English text of that key is shown and the console says so once. A value of the wrong shape (messages: 'Anuluj', locale: 5) is a mistake in your code and is refused where you wrote it: setLanguage throws a TypeError that names the option and changes nothing, and a mount call fails with MOUNT_FAILED and the TypeError as its cause.
Pop-ups
The File Browser answers a rename, a delete, a new folder and a pick with a small pop-up in the bottom corner of the box you gave it (the right one, or the left one for a language written right to left), in the piece’s theme and in your language. Their words are messages like the rest: thetoast. keys, with toast.regionLabel (the name of the region a screen reader announces them in) and toast.closeLabel (the name of the close button). After a pick the piece says “Files selected”, not the Widgetic site’s “Added 2 files to the editor”. The sentence under “Rename failed” or “Failed to delete” is your library’s own and is shown as it arrives.
Two habits come with the pop-up library. It moves focus to the newest pop-up when someone presses Alt+T anywhere on the page while one is shown, and a pop-up goes away by itself after about three seconds. You cannot move the pop-ups or switch them off yet.
The Composition Editor
The Composition Editor takes the samelocale, messages and setLanguage, and its module.defaultMessages and module.checkMessages(messages) work as above. One thing is different: one messages object covers the whole editor. The editor is made of three parts with words of their own, and it splits what you give between them, so you never need to know which part says a word:
- the editor’s own words, the
editor.keys: the Design and Content tabs, every control, the save button, the dates and the failures it explains; - the file picker that opens from its file fields, which is the File Browser: the keys above (
action.,upload.,dialog.and so on), with the samelocaleandmessages; - the rich text editor of its text fields, the
shadEditor.keys. The editor draws its own text toolbar, so these words are not on screen today and a translation can leave them out.
editor.module.defaultMessages lists them all, with their English text: more than 500. A key that is in none of the three is said once in the console as [Editor] ..., with the nearest real key, and ignored.
- Dates follow
localewithout your help. The names of the months and weekdays in its calendars, and the way a date is written, come from the browser. Only the names of the calendars and of their buttons (what a screen reader says) are messages. The date range control shows dates the way the language writes them: 7 October 2026 reads10/07/26withen(and with nolocale),07/10/26withen-GB,07.10.26withdeandpl, and26/10/07withja, so giveen-GBwhen you want the day first in English. A weekday heading in a calendar is the language’s own short name, not cut to two letters. In a language written right to left it is the one-letter name instead (Arabicح ن ث ر خ ج س), because the short names of Arabic are whole words that do not fit a column, and the whole name is the label of the heading for a screen reader. Where the browser has no one-letter names for a language (Urdu), the short names stay. Values saved in the composition stay structured dates, the same in every language. - A change of language reaches what is on screen. Labels and buttons change at once, and so do the banners of a composition that could not be opened and of a save that failed. A sentence the editor said once, such as why there is no preview, keeps its language until the editor says something new.
- Pop-ups from its file picker. A rename, a delete, a new folder and a pick raise a small pop-up inside the module’s box, in your language (
toast.keys, includingtoast.regionLabelandtoast.closeLabel). After a pick the module says “Files selected”, not “Added … to the editor”.
The Embed Editor
The Embed Editor takes the samelocale, messages and setLanguage, and its module.defaultMessages and module.checkMessages(messages) work as above. One messages object covers the whole editor: its own words (the editor.embed. keys: the code box, the copy button, the status line, the banners of a failed load or save), the assistant’s (editor.embedAssistant.) and the words of the controls the options are made of (the other editor. keys). It speaks from the same catalog as the Composition Editor, so a page that translated the Composition Editor’s words has translated these too. embed.module.defaultMessages lists them all, with their English text. A key that is in none of them is said once in the console as [Editor] ..., with the nearest real key, and ignored.
- There are no built-in languages yet.
localedecides the plural forms, how numbers and dates are written and which way the screen reads, and the words stay English unless yourmessagessay otherwise. - The options keep their English names. The name of each option, its group, its hint and the choices of its menus come from the widget’s embed options, not from the editor, so
messagesdoes not reach them. The assistant answers in the language the customer writes in. - The embed code is read left to right in every language, and the editor’s own
errorevents keep their Englishmessage(usecode).
The Widget Creator
The Widget Creator takes the samelocale, messages and setLanguage, and its module.defaultMessages and module.checkMessages(messages) work as above. Like the Composition Editor, one messages object covers the whole creator. It is made of parts with words of their own, and it splits what you give between them, so you never need to know which part says a word:
- the creator’s own words, the
creator.keys: the widget’s panel, publishing and versions, the chat’s generation options (the language and, in debug mode, custom libraries), the limits it explains, the lines of its status bar; the preset Libraries toggle and its add-library control appear only in creator debug mode, which the Widget Creator module does not turn on, but their messages stay in the catalog for hosts that do; - the chat’s words (
chat.keys) and the canvas’s (canvas.keys: the toolbar, the zoom controls, the context menu, the properties panel, the words the shapes draw on the canvas); - the two words of the region its pop-ups are announced in,
toast.regionLabelandtoast.closeLabel, which are the File Browser’s keys of the same names, so one translation serves both; - the Composition Editor with its file picker and its rich text editor (the
editor.keys, the File Browser’s andshadEditor.). The creator’s composition steps are off in a session, so these are on no screen today and a translation can leave them out.
creator.module.defaultMessages lists them all, with their English text: more than 1,300.
- Dates follow
localewithout your help. The date and time of a version are written the way the language writes them (10/01/2026 14:05in English,01.10.2026 14:05in Polish,2026/10/01 14:05in Japanese). Only the words around them are messages. - A change of language reaches what is on screen. The canvas, the chat, the panels, the menus and the pop-ups change at once, with no new mount. As for the other pieces,
setLanguagekeeps what you leave out and replaces the messages. - A mistake never breaks the screen. A key that none of the parts has is said once in the console as
[Creator] ..., with the nearest real key. A text that cannot be used is said once by the part that owns the key ([Creator],[Chat],[Canvas],[Editor],[FileBrowser],[ShadEditor], or[WidgetCreatorModule]for the pop-up region), and the English text of that message is shown.
The Workflows screen
Workflows takes the samelocale, messages and setLanguage, and its module.defaultMessages and module.checkMessages(messages) work as above. It has one messages object for all of it: a few hundred messages whose keys start with workflows., for the list, the editor and its panels, the names of blocks, operators and units, what is wrong with a workflow that cannot be published, what a failed request means, and the words of the screen that says a part could not be drawn. The words of a block are made of parts the screen puts together ({field} {value}, {count, plural, ...}), so a language that puts them in another order can say so in its own message. All 65 built-in languages come with these words. A key you leave out keeps them (English when your locale has none).
Right to left
The File Browser, the Composition Editor, the Embed Editor, the Widget Creator and Workflows are read the way your customer’s language is written. For Arabic, Hebrew, Persian, Urdu and the other languages written from right to left, the whole screen turns around and a line starts on the right.setLanguage({ locale: 'ar' }) turns a piece that is on screen around, and setLanguage({ locale: 'de' }) turns it back, with no new mount.
- The File Browser. The list starts on the right, the search box, the sort and filter controls, the selection bar, the upload panel and the windows are laid out from the right, the close button of a window is in the corner where a line starts, menus open toward the end of the line, the pop-ups come up in the bottom left corner, and the arrows that mean back and forward are mirrored. In the preview, the arrow key that points toward the end of the line goes on to the next file.
- The Composition Editor. The settings panel is docked at the start of the line, on the right, and the preview on the other side, the same distance from the middle as in English. The Design and Content tabs run from the start of the line, the label of a control is at the start of its row, the calendars start their week at the start of the line, and sliders and switches run from the start. The file picker that opens from a file field is the File Browser above.
- The Embed Editor. With the assistant on (the default), the options panel is docked at the start of the line, on the right, and the assistant’s column on the other side; with
assistant: falseonly the options panel is shown. The label of an option is at the start of its row, and menus open toward the end of the line. The embed code is the exception: it is code, so it is read from left to right in every language, and a right to left screen keeps the<of its first tag at the left. - The Widget Creator. The tools of the toolbar run from the start of the line, the properties panel is docked at the end of it, the menus, the list of shapes and the publish history are laid out from the start. The Composition Editor and the File Browser inside it are turned around the same way.
- Workflows. The list, the top bar of the editor, the tabs, the side panel, the menus and the dialogs are laid out from the start of the line, as a whole. The canvas is the exception: a workflow is read from its first block forward, so it is drawn from left to right in every language, and its lines run from a block on the left to the next one on its right.
- What a customer types. A text field, the tags of the editor, the chat and the text fields of the quick edit are read by their own first letter: a sentence in Latin letters is set from the left and one in Arabic from the right, side by side. A field with nothing in it yet takes the direction of the screen. An email, a link and a colour code stay left to right on every screen.
- Only
localedecides. The direction of your page does not: a page written right to left (<html dir="rtl">) leaves an English piece alone, and a page written left to right does not stop an Arabic one. Changingmessagesalone changes nothing about it. - Names. File and folder names are read by their own first letter, so a Latin name next to Arabic ones is not put in the wrong order. In a language written right to left, a name inside a sentence (“Failed to delete 2024 report.pdf”) sits between two invisible marks (Unicode isolates U+2068 and U+2069), so the words around it cannot turn it around. A screen reader does not say them; leave them out when a test compares the text of a pop-up.
- The video time line stays left to right, because time runs that way in every language.
- Drawings stay left to right. The drawing board of the Widget Creator, the live previews of widgets and the code are left to right in every language, and so are the drawings that mean “left” and “right” in the Composition Editor (the saturation and hue of the colour picker, the grid that places a box, the corners of a rounded box). A drawing is not a line of text, and a widget’s own preview must look the way its author made it.
- Two small things are open. The weekday names of an Urdu calendar are the short ones, which are whole words because the browser has no one-letter names for Urdu, so that row is tight. And the panel of a widget in the creator opens on the side of its shape that has more room, as it does in English, without knowing where the properties panel is: for a shape near the middle of the board it can open over that panel.
What stays as it is
- Words that belong to someone else. What your own media library says (the message of an error you throw), your file names and your library’s
label, the names of folders a customer made, and a sentence Widgetic’s API sends back are shown as they arrive. errorevents. Theirmessageis English: it is for your logs.- What is saved with a composition. The title of a new item (“Item 03”), “Untitled Composition” and the names a font weight or a position is saved under (“ExtraBold”, “top-left”) are written into the composition when they are made, so they stay English. The editor shows the weights and the positions in your language.
- The widget author’s words. The names, labels, descriptions and placeholders of a widget’s settings, its default texts and the names of typefaces are shown as the author wrote them.
- Your customers’ words in Workflows. The names of workflows and of compositions, the event names a customer types into a trigger, and the names of the tables, columns and actions of a widget are shown as they were written.
- What the customer and the AI write. The prompts, the answers, the names of widgets and the code are the customer’s and the AI’s. In the Widget Creator, lines the creator saved into the chat stay English in the API; on screen it translates known lines (a failed generation, a restore) at display time. The
messageof itslimitReachedevent stays English (usecode). - What a session never draws. The Widget Creator’s sign-in screen, its standalone header, its debug panels, the preset Libraries section of the chat’s generation options, its list of keyboard shortcuts and its composition steps are not shown in a session, so they are not translated.
Tokens
getToken is the only credential the SDK takes. It is called with { reason }:
'initial': the piece is starting.'expiring': the current token runs out in about a minute. Return its replacement now.'expired': the current token has already run out (the page was asleep, or an earlier refresh failed).
{ token, expiresAt } (an ISO string, epoch milliseconds or a Date). With expiresAt the piece renews the token in time and the customer is never interrupted. The answer of your own endpoint can pass on what Widgetic gave you.
When your getToken answers an 'expired' call with the very token the API had refused, the piece takes it that you have no better one. It does not ask again for five seconds, whatever asks, so a session that was ended is reported once and not once per request.
An apiKey option is refused with API_KEY_NOT_ALLOWED. The key must stay on your server.
Every piece asks for its token in this way: it is always the token of the editor session of the customer who is on the page.
Content Security Policy
If your page sends a Content-Security-Policy, the File Browser works with this and nothing more. The build tests load it under the same policy, list, pick and upload images and preview a PDF; each source below is needed.img-src also needs the address your customers’ files are served from (the url of a picked file). To preview a PDF, that address also goes in connect-src (the PDF is downloaded with a request, so the file server has to allow your page’s origin with CORS) and the policy needs the worker-src blob: above; without it the preview says “Failed to load PDF” and everything else works. No data: in script-src and no 'unsafe-eval' are needed. The PDF viewer is downloaded when the first PDF is previewed, from the same folder of the CDN as the piece itself, so script-src needs nothing more.
- The Composition Editor works under the same policy plus
frame-src https://cdn.widgetic.com(the live preview is the widget’s published page). Its font picker also needsstyle-src https://fonts.googleapis.comandfont-src https://fonts.gstatic.com. - A font of your own (
theme.font.stylesheetUrl) needs its stylesheet’s host instyle-srcand its font files’ host infont-src. See A font your page does not load yet. - The Widget Creator needs what the Composition Editor needs plus
frame-src https://wbuilder.widgetic.comandconnect-src https://wbuilder.widgetic.com(the live previews of widgets are served from there). - Workflows needs less than the File Browser:
script-src,style-src 'unsafe-inline'andfont-src data:, plus two sources of its own.connect-srchas to allow the API (yourapiUrl,https://api.widgetic.comunless you run your own), andimg-src https://cdn.widgetic.comis for the pictures of compositions in the list and on the canvas. It needs noframe-src, noworker-src, no inline script and noeval. Together:default-src 'none'; script-src 'self' https://cdn.widgetic.com; connect-src https://cdn.widgetic.com https://api.widgetic.com; style-src 'unsafe-inline'; font-src data:; img-src https://cdn.widgetic.com. Theconnect-src https://cdn.widgetic.comis the SDK’s request for the manifest, as for every piece, and it is not made when you pin aversion. - The Embed Editor needs the least:
script-src,style-src 'unsafe-inline',font-src data:andconnect-srcfor the API (yourapiUrl,https://api.widgetic.comunless you run your own), where the options are read and saved and where the assistant answers as a stream. It needs noimg-src, noframe-src, noworker-src, no inline script and noeval. Together:default-src 'none'; script-src 'self' https://cdn.widgetic.com; connect-src https://cdn.widgetic.com https://api.widgetic.com; style-src 'unsafe-inline'; font-src data:. Theconnect-src https://cdn.widgetic.comis the SDK’s request for the manifest, as for every piece, and it is not made when you pin aversion. The Widgetic build tests open the editor under a policy with exactly these sources, edit and save the options and talk to the assistant under it, and fail on any violation.
allowedOrigin instead.
What the SDK puts on your page
- On import: nothing.
- While a piece downloads: one
div[data-widgetic-ui-loading]in your container, removed when the piece is up. - A mounted piece: one
<widgetic-ui-module>element in your container, holding a shadow root. The pieces also add one<style data-widgetic-ui-document-rules>to<head>with@font-facerules for fonts namedWidgetic UI …, so they cannot collide with yours. That<style>is shared by every piece on the page and never added twice, so it stays when a piece is unmounted. The Composition Editor also adds Google’s stylesheet for each font the customer looks at in its font picker; those<link>s go when the editor is unmounted. Your own<link>s and<meta>s are never touched. - Never: global CSS or CSS variables, changes to
<html>or<body>,postMessage, or removing your own elements.
React
mountModule the piece’s name ('composition-editor', 'embed-editor', 'widget-creator' or 'workflows') and its options. The Widgetic build tests run it in a React 18 page, with and without <React.StrictMode>, for all five pieces. The same pattern works in Vue and Svelte: mount in the component’s mount hook with an AbortController, and abort and unmount when it goes away. Mounting needs a page, so start it from an effect or an event handler: calling mountModule while rendering on a server rejects with NOT_IN_BROWSER.
Versions and self-hosting
Pieces are static files, so nothing can change under your feet when you pin a version:- Without
versionthe SDK reads the manifest and loads the newest version. Withversion: '0.1.0'it loads that file directly. Pin the version in production and upgrade when you have looked at the release. - Read what changed before you move. Every version has an entry in the changelog, and a version that can break your page is marked
breaking. See Versions & Changelog. - To serve the pieces yourself, copy that layout to your own origin (the whole
<version>folder:index.jsfetches itschunks/files from the folder it was loaded from) and setmoduleBaseUrl. The manifest’sentrymust be a.jsfile inside the piece’s own folder on the same origin. - Failed downloads are retried twice (network errors and server errors, not 404). A piece also asks twice more, the same way, when a file it fetches later fails. Requests to the CDN carry no cookies.
Errors
Every error carries acode.
Next Steps
Editor Sessions
Make the token on your server
Widget Creator
The canvas and the agentic chat
Composition Editor
Change the texts, pictures and colours of a widget
Workflows
Let your customers chain compositions
Managed Users
File your customers’ content under them
Credits & Billing
How the AI is paid for



