Skip to main content
Import SDK ABI 1 in your component source. Its implementation belongs to the installed FLEX runtime; your package contains a small versioned facade.
For example, release a pending activation wait with the same owner:
Import both functions in that example. createResourceScope() supports onCleanupError and onEffectError callbacks. It exposes defer(callback), listen(target, event, callback, options), trackStream(stream), timeout(callback, milliseconds), interval(callback, milliseconds), frame(callback), trackObserver(observer), trackWorker(worker), objectUrl(blob) returning { url, revoke }, dispose(), disposed and signal. The optional constructor signal disposes the whole scope when aborted. Every registration returns an idempotent release function; completed one-shot effects remove their bookkeeping immediately. snapshot() reports only the resource count and disposed state. One failed cleanup does not prevent the remaining cleanups. Set limit to bound the number of simultaneously owned effects (default 4096, accepted range 1–65536). Completed timers and released listeners leave this budget immediately. If adoption fails, a supplied worker, observer, stream or new object URL is cleaned up. A rejected defer(callback) has not acquired the callback; it does not run it. Treat a budget error as initialization failure and dispose the partially initialized owner before retrying. For channels, supply their names and retain the returned unsubscribe handle:
Use the esbuild adapter shipped in your installed Composer package:
Adjust the Composer path to your build directory. Both metafile: true and write: false are required. Then run the portable manifest compiler. There is no import map or deployment URL to configure for the SDK facade. The adapter rejects unsupported SDK imports and builds containing installed FLEX private JavaScript, including symlink aliases. Use the public import rather than copying source files. Installed packages remain trusted application code. Mount the default factory through its registered FLEX consumer boundary. The SDK is installed before that factory is imported. Calling the facade outside a compatible runtime raises an explicit error. Main factories already receive FLEX readiness handling; do not register a second factory wrapper under their name. SDK versioning does not merge incompatible versions of your own libraries.

Continue reading

SDK reference · Factories and lifecycle
Last modified on October 17, 2026