PMA

How to integrate PMA functionality to group type widget

Init the Widget Manually

<script src="https://cdn.jelou.ai/widgets/loader.js"></script>

Subscribe to the initial load event

document.addEventListener('jelou-widget:load', () => {
    // Access to WidgetService 
    const widgetService = new WidgetService({ apiKey: '<apiKey>' });
    widgetService.connect({
        optoken: "<someOpToken>" 
    }).then(() => {
        console.log("Success! 🚀")
    });
});

Create a WidgetService instance

const widgetService = new WidgetService({ apiKey: '<apiKey>' });

Connect WidgetService, here the user must provide:

  • optoken (operator token) of the user.

This optoken is provided after creating a operator in the PMA service.

widgetService.connect({
    optoken: "<someOpToken>"
}).then(() => {
    console.log("Success! 🚀")
});
type Connect = {
    optoken: string;
}

Last updated