DGW.mount
Usage: DGW.mount(opts);
Mount Initialization Options
Use these options when calling DGW.mount(opts).
Core options
| Parameter | Type | Required | Description |
|---|---|---|---|
| containerId | string | Conditionally | ID of the container element where the plugin will be rendered. Use this or container. |
| container | HTMLElement | Conditionally | Direct DOM element where the plugin will be rendered. Use this or containerId. |
| portalRootContainer | HTMLDivElement | No | Custom portal root for modals and overlays. Useful if you need popups rendered into a specific DOM subtree. |
| overrideThemeVars | DgwThemeVars | No | Runtime theme variable overrides (brand color, rounding, font family). |
| view | DgwView | Yes | Defines which plugin view is rendered. |
| sessionId | string | Conditionally | Existing session ID to load. Use this or merchantId. |
| merchantId | string | Conditionally | Merchant ID for plugin-managed session creation. Use this or sessionId. |
| themeHandle | string | No | Applies a configured theme by handle. |
| sessionInitOpts | CreateSessionInput | No | Session creation payload used with merchant-based initialization. |
| disableShadowDOM | boolean | No | Disables Shadow DOM encapsulation so host page styles can affect plugin internals more directly. |
Callback options
| Parameter | Description |
|---|---|
| onAddressSelected | Triggered when user selects an address or pickup point. Can return validation result to block/allow continuation. |
| onAddressSelectionSucceeded | Triggered after a successful address or pickup selection flow. |
| onAddressBeforeCreate | Called before creating an address. Can modify flow data (for example referenceId). |
| onAddressCreated | Called after an address is created. |
| onAddressBeforeUpdate | Called before updating an address. Can modify flow data (for example referenceId). |
| onAddressUpdated | Called after an address is updated. |
| onAddressDeleted | Called after an address is deleted. |
| onSessionLoaded | Called when session data has finished loading. |
| onClosed | Called when the plugin UI is closed (for example modal close). |
Theme override object (overrideThemeVars)
| Field | Type | Description |
|---|---|---|
| brand_color | string | null | Primary brand color override. |
| surface_rounding | rounded | square | null | Controls surface corner style. |
| button_rounding | full | default | square | null | Controls button corner style. |
| font_family | string | null | Global font family override. |
View-specific options
delivery-method-selection
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | delivery-method-selection | Yes | Selects the delivery method selector view. |
| openSelectedMethodInModal | boolean | No | Opens pickup/address step in modal instead of inline flow. |
| operatorsAsSeparateMethods | boolean | No | Renders pickup operators as separate delivery method options. |
| showHomeDeliveryOperatorIcons | boolean | No | Displays operator icons for home delivery methods. |
| homeDeliveryOverride | object | No | Customizes home-delivery selection behavior. |
| homeDeliveryOverride.onSelect | () => boolean | Promise<boolean | undefined> | undefined | No | Intercepts selection and can allow/deny custom logic. |
| homeDeliveryOverride.initialSelected | boolean | No | Sets initial selected state for home-delivery override flow. |
| customPickupPointAsSeparateMethod | boolean | No | Renders custom pickup points (merchant's stores) as separate delivery method options in the delivery method selection step. |
pickup-point-selection
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | pickup-point-selection | Yes | Selects standalone pickup point selector view. |
| openInModal | boolean | No | Opens selector in modal mode. |
| hideMainLoadingIndicator | boolean | No | Hides main loading indicator during init and post-selection states. |
| selectedOperatorFilters | OperatorEnum[] | No | Preselects operator filters. |
| ownShopFilterSelected | boolean | No | Preselects own-shop filter. |
address-selection
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | address-selection | Yes | Selects standalone address selector view. |
| openInModal | boolean | No | Opens selector in modal mode. |
| hideMainLoadingIndicator | boolean | No | Hides main loading indicator. |
profile-page-address-list
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | profile-page-address-list | Yes | Renders profile address management page/list view. |
Related DGW API for preloading
| Method | Signature | Description |
|---|---|---|
| preloadSession | preloadSession({ apiUrl, sessionId, merchantId, sessionInitOpts }): Promise<void> | Preloads session-related data before mount to reduce perceived latency on first open. |
| getI18nLanguage | getI18nLanguage(): HU | EN | NL | Returns the active plugin language code. |
The returned DGW instance fields
| Field name and format | Type | Description |
|---|---|---|
| unmount() | () => void | Immediately unmounts the instance, removing all content from the container. |
| isMounted() | () => boolean | Returns a boolean indicating whether the instance is still mounted. |