Appearance
Are you an LLM? You can read better optimized documentation at /docs/custom-widgets/v2/sdk-api-reference.md for this page in Markdown format
Widget SDK Reference
This page documents the SDK instance that the platform passes to your widget's init(sdk) function. For installation and connector-calling usage, see the Widget SDK section.
Properties
| Property | Type | Description |
|---|---|---|
root | ShadowRoot | The widget's shadow root (mount target) |
shadowRoot | ShadowRoot | Alias for root — the same shadow root reference |
document | Document | Global document reference |
version | string | SDK version (e.g. "1.5.2") |
Methods
| Method | Returns | Description |
|---|---|---|
getContainer() | ShadowRoot | Returns the widget's shadow root — recommended mount target for framework apps (React, Vue, etc.) |
getProps<T>() | T | Current widget props (from configuration) |
setProps(props) | void | Update props (emits propsChanged) |
getDesignTokens() | DesignTokens | Current community CSS custom properties |
getVersionInfo() | VersionInfo | { version, gitSha, buildTime } |
whenReady() | Promise<SDK> | Resolves when the SDK is fully initialized |
$(selector) | Element | null | Shorthand for shadowRoot.querySelector(selector) |
$$(selector) | Element[] | Shorthand for shadowRoot.querySelectorAll(selector) — returns an array, not a NodeList |
on(event, handler) | () => void | Subscribe to an event (returns unsubscribe fn) |
off(event, handler) | void | Unsubscribe from an event |
emit(event, data?) | void | Emit a custom event |
Built-in Events
| Event | Payload | Trigger |
|---|---|---|
propsChanged | Record<string, unknown> | Widget configuration changes |
designTokensChanged | Record<string, string | null> | Community branding/theme updates |
destroy | undefined | Widget removed from DOM |
error | { message: string, error?: Error } | Module load or initialization error |
Next Steps
- Widget Runtime — Runtime model, lifecycle, props, and design tokens
- Widget Configuration — Let editors customize your widget via a form in the No-Code Builder
- Using React — Build widgets with React

