swish.utils and swish.ui for common tasks that don’t fit into the other namespaces.
swish.utils
copyToClipboard(text)
Copy a string to the user’s clipboard. Returns a result object indicating success or failure.
Returns
Promise<{ ok: true } | { ok: false; issues: string[] }>
Falls back gracefully when the Clipboard API is unavailable (e.g. insecure contexts), returning { ok: false, issues: ["Clipboard API not available"] }.
createShareUrl({ publicListId })
Generate a shareable URL for a public list. The URL is constructed from your store’s domain and the configured listDetailPagePath.
Returns
URL
swish.ui
createElement(name)
Create a Swish UI custom element programmatically. The element is returned as an HTMLElement that you can append to the DOM.
Returns
Promise<HTMLElement>