Skip to main content

DGW.mount

Usage: DGW.mount(opts);

Mount Initialization Options

Use these options when calling DGW.mount(opts).

Core options

ParameterTypeRequiredDescription
containerIdstringConditionallyID of the container element where the plugin will be rendered. Use this or container.
containerHTMLElementConditionallyDirect DOM element where the plugin will be rendered. Use this or containerId.
portalRootContainerHTMLDivElementNoCustom portal root for modals and overlays. Useful if you need popups rendered into a specific DOM subtree.
overrideThemeVarsDgwThemeVarsNoRuntime theme variable overrides (brand color, rounding, font family).
viewDgwViewYesDefines which plugin view is rendered.
sessionIdstringConditionallyExisting session ID to load. Use this or merchantId.
merchantIdstringConditionallyMerchant ID for plugin-managed session creation. Use this or sessionId.
themeHandlestringNoApplies a configured theme by handle.
sessionInitOptsCreateSessionInputNoSession creation payload used with merchant-based initialization.
disableShadowDOMbooleanNoDisables Shadow DOM encapsulation so host page styles can affect plugin internals more directly.

Callback options

ParameterDescription
onAddressSelectedTriggered when user selects an address or pickup point. Can return validation result to block/allow continuation.
onAddressSelectionSucceededTriggered after a successful address or pickup selection flow.
onAddressBeforeCreateCalled before creating an address. Can modify flow data (for example referenceId).
onAddressCreatedCalled after an address is created.
onAddressBeforeUpdateCalled before updating an address. Can modify flow data (for example referenceId).
onAddressUpdatedCalled after an address is updated.
onAddressDeletedCalled after an address is deleted.
onSessionLoadedCalled when session data has finished loading.
onClosedCalled when the plugin UI is closed (for example modal close).

Theme override object (overrideThemeVars)

FieldTypeDescription
brand_colorstring | nullPrimary brand color override.
surface_roundingrounded | square | nullControls surface corner style.
button_roundingfull | default | square | nullControls button corner style.
font_familystring | nullGlobal font family override.

View-specific options

delivery-method-selection

ParameterTypeRequiredDescription
typedelivery-method-selectionYesSelects the delivery method selector view.
openSelectedMethodInModalbooleanNoOpens pickup/address step in modal instead of inline flow.
operatorsAsSeparateMethodsbooleanNoRenders pickup operators as separate delivery method options.
showHomeDeliveryOperatorIconsbooleanNoDisplays operator icons for home delivery methods.
homeDeliveryOverrideobjectNoCustomizes home-delivery selection behavior.
homeDeliveryOverride.onSelect() => boolean | Promise<boolean | undefined> | undefinedNoIntercepts selection and can allow/deny custom logic.
homeDeliveryOverride.initialSelectedbooleanNoSets initial selected state for home-delivery override flow.
customPickupPointAsSeparateMethodbooleanNoRenders custom pickup points (merchant's stores) as separate delivery method options in the delivery method selection step.

pickup-point-selection

ParameterTypeRequiredDescription
typepickup-point-selectionYesSelects standalone pickup point selector view.
openInModalbooleanNoOpens selector in modal mode.
hideMainLoadingIndicatorbooleanNoHides main loading indicator during init and post-selection states.
selectedOperatorFiltersOperatorEnum[]NoPreselects operator filters.
ownShopFilterSelectedbooleanNoPreselects own-shop filter.

address-selection

ParameterTypeRequiredDescription
typeaddress-selectionYesSelects standalone address selector view.
openInModalbooleanNoOpens selector in modal mode.
hideMainLoadingIndicatorbooleanNoHides main loading indicator.

profile-page-address-list

ParameterTypeRequiredDescription
typeprofile-page-address-listYesRenders profile address management page/list view.
MethodSignatureDescription
preloadSessionpreloadSession({ apiUrl, sessionId, merchantId, sessionInitOpts }): Promise<void>Preloads session-related data before mount to reduce perceived latency on first open.
getI18nLanguagegetI18nLanguage(): HU | EN | NLReturns the active plugin language code.

The returned DGW instance fields

Field name and formatTypeDescription
unmount()() => voidImmediately unmounts the instance, removing all content from the container.
isMounted()() => booleanReturns a boolean indicating whether the instance is still mounted.