Steps to Install the mmob React SDK

Installing mmob's package allows you to run embedded services served from mmob's platform.

Prerequisites

The SDK is accessible via an NPM package.

Step 1: Install your React Integration

You can install the mmob React SDK directly from the terminal

npm install git+ssh://git@github.com:mmob-tech/mmob-react-sdk

To install a specific version you can pass the version tag:

npm install git+ssh://git@github.com:mmob-tech/mmob-react-sdk#1.0.15

Step 2: Import the SDK into a React Component for your App

import MMOB, {MMOBConfig } from 'mmob-react-sdk';

export const App = (props) => {

  const mmobConfig: MMOBConfig = {
    deployerId: "xxxxxxxxxx",
    integrationId: "xxxxxxxxxx",
    integrationServerUrl: "xxxxxxxxxx",
    uid: props.email,
  }

  return <>
    <h1>Demo App</h1>
    <MMOB
      config={mmobConfig}
      viewId="stats"
    />
  </>
}

Note: you will be assigned a unique deployerId and integrationId by mmob

Note: your integrationServerUrl will depend on the tenancy option you have selected. This can be confirmed by mmob if required.

Step 3: Configure the Desired Width and Height of the iframe

Note that the MMOB component returns a <div> that will mount the embedded application.

You may pass any HTML prop/attribute you need to it to pass on to the underlying div.

For example, you may pass a className or style:

  <MMOB
    config={mmobConfig}
    viewId="stats"
    className="embedded-app"
    style={ {
      border: "2px solid red",
      width: "100%",
      height: "250px",
    }}
  />

Was this page helpful?