Methods
API Reference for the MediquoWidget library.
Method init(config)
Initialize the MediquoWidget with your configuration.
MediquoWidget.init({
apiKey: "<YOUR-API-KEY>",
accessToken: "<USER-ACCESS-TOKEN>",
theme: {
text: {
title: "My Title",
},
colors: {
primary: "#4A1EA7",
},
},
});
Config
apiKey: Required. The API Key of your organization. How to get an API KeyaccessToken: Access Token issued by mediQuo server to authenticate your patient. Check more on how to authorize patients. If you want to skip this option completely, you can omit this value and a registration form will be displayed in order to create a temporal user.showOptional. Default: 'always'. Use this option to customize the visibility of the widget. Options available arealways,withActiveSessionandonlyIfAvailable.themeOptional. Default: {} Use this option to customize the widget to match your organization colors. You can find more about widget customization.
Method open()
Open the MediquoWidget programmatically from anywhere.
MediquoWidget.open();
Method getPendingConsultations()
Get number of pending consultations.
MediquoWidget.getPendingConsultations();
Method close()
Close the MediquoWidget programmatically from anywhere.
MediquoWidget.close();
Method logout()
Logout the user programmatically from anywhere. It destroys the session and invalidates the access token. To be able to show again the widget to the user another access token should be requested.
MediquoWidget.logout();
Method destroy()
Remove the widget from your site completely. This method executes a logout and remove the widget elements from your DOM.
If you want to show again the widget after using the destroy, you can call the init method again.
MediquoWidget.destroy();
Method open_room(professional_id)
Open a chat room programmatically with a specific professional by providing the id.
MediquoWidget.open_room("<PROFESSIONAL_ID>");
Method open_list()
Open chat list inbox programmatically from anywhere.
MediquoWidget.open_list();