InTandemMessageHandler

Overview

MessageHandler is a utility provided by the intandem-app-com package for managing communication and handling incoming messages. This includes processing messages and acknowledging receipt with optional success or failure details.


Installation

Ensure you have the intandem-app-com package installed:

npm i @vcita/intandem-app-com

Importing and Initializing

To use the message handler:

import messageHandler from '@vcita/intandem-app-com';

await messageHandler.init(window.parent, window);

Functions

FunctionDescription
initInitialize the message handler
addEventListenerListen to incoming events from the platform
removeEventListenerRemove existing listeners
getAuthGet an authorization token to use with JWKS
getUserGet the basic details about the user (impersonation, locale, current domain...)
getStateGet the state of the current host (widget or page)
setStateSet the state of the current host (widget or page)
navigateNavigate to a different page in the system
openModalOpen a system modal over the current page
destroyRelease any resources before exiting