eLabSDK2.UI.ExternalDialog
Hierarchy
-
default↳
ExternalDialog
Methods
open
Static open(config): Promise<unknown>
Open a host-controlled or add-on-developer-hosted page in a popup and resolve with whatever the page postMessages back. Provider-agnostic transport for picker / config / wizard pages so eLab core does not carry provider-specific UI code.
Protocol:
- Host opens
window.open(config.url, …). - The dialog page sends
{ type: 'sdk:ready' }viawindow.opener.postMessageonce mounted. - Host replies with
{ type: 'sdk:init', data: config.init }. - Dialog does its work, then sends
{ type: 'sdk:result', data: <value> }. Host resolves withdata. - Popup-close or 5-minute timeout resolve
undefined, which add-ons can interpret as "user cancelled".
URL acceptance rules — see ExternalDialogConfig.url.
Origin checks: every inbound postMessage must come from the popup's
exact origin and from the popup window — defends against forged
messages from a co-resident frame.
Parameters
| Name | Type |
|---|---|
config | ExternalDialogConfig |
Returns
Promise<unknown>
Example
const items = await eLabSDK2.UI.ExternalDialog.open({
url: '/resources/boxcom/picker.html',
width: 750,
height: 700,
init: { accessToken, extensions: ['jpg', 'png'] },
});© 2026 eLabNext
Updated about 3 hours ago