Skip to content

Web SDK

This document provides a technical reference for the functionality available in the MMOB React SDK. The SDK exposes various methods on the global mmob object. Each section below details the available methods, their parameters, and expected usage.

Methods

init

Fields

AttributeTypeRequiredDefaultDescription
deployer_idstringYesN/AThe unique identifier of the entity deploying the application.
integration_idstringYesN/AA unique identifier for the specific integration instance. It represents a particular configuration of the application, distinguishing it from other integrations. It is generated on instance creation.
locationstring | HTMLElementYes`#YOUR-TARGET-ELEMENT`Defines the location where the embedded application will be placed.
A CSS selector string (e.g., "#app-container", ".embed-target").
A direct DOM element reference (e.g., document.getElementById("app-container")).
owner_idstringYesN/AThe unique identifier of the owner of the application.
view_idstringNoN/AAn optional unique identifier for the initial view (or page) that the application will render. If not provided, the application will default to rendering the first created view.
uidstringNoN/AThe uid is an optional unique identifier for the user. It can be any value that uniquely represents the user, such as an email or a custom user ID. For more details, see Managing User Sessions.
data_passportRecord<string, string | number | boolean>NoN/AAn optional object for "passporting" or sending data into the application, making it available for use inside the embedded environment.
The object consists of key-value pairs where:
Keys must be string.
Values can be string, number, or boolean.
This allows passing configuration settings, user-specific data, or other contextual information the application needs at runtime. For more information, see Data Passporting
initial_loading_asset`LoadingAsset`No`spinner`An optional configuration for rendering a loading asset while the application initially boots. It accepts various loader types and properties. See Configuring Loading Visuals for more details.
customerInfo`LoadingAsset`No`spinner`Optional customer specific information that can be encrypted and signed. See (secure deployment docs - coming soon) for more details.
encryptedPassport`LoadingAsset`No`spinner`Optional signed information in JWS format. See (secure deployment docs - coming soon) for more details.
signedDeployment`LoadingAsset`No`spinner`Optional encrypted information in JWE format. See (secure deployment docs - coming soon) for more details.

Usage

  • The snippet is generated with #YOUR-TARGET-ELEMENT as the default location value, but this must be modified to match an actual element in your DOM. Ensure that the specified selector or element reference correctly identifies the target container where the application should be injected. If the location value is not found or remains unchanged, the application will not render.
  • If no uid is provided, a random identifier will be assigned, but this will only persist for a single session. To maintain user sessions across visits, it is strongly recommended to provide a consistent uid for each user entering your application. For more details, see Managing User Sessions.

Example

js
mmob.init({
  // Required fields
  deployer_id: "dr_RWs0O1fmlJ5ysB3e1brOp",
  integration_id: "cpd_dJcFTENMGy90ez6jP3Fwf",
  location: "#app-container",
  owner_id: "owner_mmob",
  view_id: "view_XXX",

  // Optional fields
  uid: "[email protected]",
  initial_loading_asset: {
    type: 'spinner', 
    size: 50, 
    color: '#d3d3d3'
  },
  data_passport: {
    first_name: "John",
    last_name: "Doe",
    age: 30,
    marketing_opt_in: false
  }
});

Events and listeners

Events and listeners can be used as outined in the Web SDK

Further Reading

For more guidance on using the SDK, refer to the following resources: