Skip to main content

Interface: MountRoot

Represents the root of a mounted Mimeeq component. This object provides methods to render specific embed types and unmount them when needed.

In mimeeqAuth context, this supports authentication-related embed types (LOGIN, USER_PROFILE, FORGOT_PASSWORD). In mimeeqApp context, this supports all embed types including configurators, product lists, and authentication.

Example​

// Using with mimeeqAuth (authentication embeds only)
const mountRoot = await window.mimeeqAuth.mount({
CDNPath: window.mimeeqEmbedEnv.CDNPath,
baseURL: window.mimeeqEmbedEnv.APIPath,
customerId: 'customer123',
node: document.getElementById('auth-container'),
uid: 'auth-embed'
});

// Render a login form
mountRoot.render({
embedType: 'LOGIN',
onLoginSuccess: (user) => console.log('User logged in:', user)
});

@interface

Properties​

destroy​

destroy: () => Promise<void>

Permanently destroys the mounted root and releases listeners and cached references. Unlike unmount, the root cannot be rendered again after this method is called.

Returns​

Promise<void>

A promise that resolves when destruction is complete


render​

render: RenderTree

Renders a specific embed type with the provided configuration.

The available embed types depend on the context:

  • In mimeeqAuth: LOGIN, USER_PROFILE, FORGOT_PASSWORD
  • In mimeeqApp: All embed types including configurators, product lists, etc.

Param​

config

Configuration for the specific embed type to render

Returns​

A promise that resolves when rendering is complete


unmount​

unmount: () => Promise<void>

Unmounts the rendered content while retaining the root for a later render. Use destroy when the owning embed element is being permanently removed.

Returns​

Promise<void>

A promise that resolves when unmounting is complete