The Monite Iframe App component provides a simple way to integrate Monite features into your application, ensuring smooth communication between your platform and Monite’s services. This integration leverages iframe-based rendering for a secure and efficient experience.
The Monite Iframe App offers various components that can be seamlessly integrated into your application. Below is a list of the available components:
payables: Manages payable invoices and bills.receivables: Handles receivable invoices and payment collection.counterparts: Manages information about customers, vendors, and other business partners.products: Handles product catalog and inventory management.approval-policies: Configures approval workflows for different processes.roles: Manages user roles and permissions within the system.onboarding`: Guides users through the initial setup process.To implement the Monite Iframe App, follow the steps below:
To embed the Monite Iframe App, include an <iframe> element in your HTML code, specifying the desired
component in the src attribute. For example, to embed the Receivables component:
The parameters are explained below:
The Monite Iframe App uses a secure communication channel to interact with your host application. This channel facilitates the exchange of data, such as authentication tokens.
To initiate the communication, use the MoniteIframeAppCommunicator class:
The mountSlot method sets up a communication channel for specific functionalities.
The fetch-token slot manages the retrieval of authentication tokens. You need to provide a function that fetches the token from your backend and returns it:
The function provided to the fetch-token slot will be invoked by the Iframe App whenever it needs to obtain an authentication token. This approach ensures secure token handling.
The locale slot allows you to customize the language and regional settings of the Iframe App. The interface for the
locale object is the same as for the Drop-In Component
or <MoniteProvider /> from the React SDK:
The theme slot allows you to apply custom theming to the Iframe App to match your application’s look and feel. The
interface for the theme object is the same as for
the React SDK:
You can call iframeCommunicator.mountSlot(...) multiple times to modify the theme dynamically, for example, to switch
between light and dark modes:
After mounting the necessary slots, establish a connection with the Iframe App:
To disconnect the iframe and stop communication with it you can call:
This method might be needed when the Monite Iframe App is removed from the host page.
Here is a complete version of code for the implementation:
The Monite Iframe App offers both production and sandbox environments to support development and testing.
Production: Use the production environment for your live applications.
https://cdn.monite.com/monite-iframe-app/{component}https://cdn.monite.com/monite-iframe-app-communicator.jsSandbox: The sandbox environment is designed for development and testing, allowing you to experiment without impacting live data.
https://cdn.sandbox.monite.com/monite-iframe-app/{component}https://cdn.sandbox.monite.com/monite-iframe-app-communicator.js