Methods
API Reference for the MediquoWidget library.
init(config)
Method 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.show
Optional. Default: 'always'. Use this option to customize the visibility of the widget. Options available arealways
,withActiveSession
andonlyIfAvailable
.theme
Optional. Default: {} Use this option to customize the widget to match your organization colors. You can find more about widget customization.
open()
Method Open the MediquoWidget programmatically from anywhere.
MediquoWidget.open();
getPendingConsultations()
Method Get number of pending consultations.
MediquoWidget.getPendingConsultations();
close()
Method Close the MediquoWidget programmatically from anywhere.
MediquoWidget.close();
logout()
Method 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();
destroy()
Method 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();
open_room(professional_id)
Method Open a chat room programmatically with a specific professional by providing the id.
MediquoWidget.open_room("<PROFESSIONAL_ID>");
open_list()
Method Open chat list inbox programmatically from anywhere.
MediquoWidget.open_list();