Methods
Frontnow Advisor provides a range of actions that allow you to customize the functionality of the widget and provide personalized recommendations and guidance to your website visitors.
isReady()
isReady()
Checks if the Frontnow Advisor is ready.
Returns:
boolean
-true
if the advisor is ready, otherwisefalse
.
Example usage:
if (advisor.isReady()) {
console.log('Advisor is ready!');
}
open()
open()
Opens the Frontnow Advisor widget.
Example usage:
advisor.open();
close()
close()
Closes the Frontnow Advisor widget.
Example usage:
advisor.close();
showEoC()
showEoC()
Opens the Frontnow "End of Conversation" widget.
Example usage:
advisor.showEoC();
closeEoC()
closeEoC()
Closes the Frontnow "End of Conversation" widget.
Example usage:
advisor.closeEoC();
showLauncher()
showLauncher()
Shows the Frontnow Advisor launcher button.
Example usage:
advisor.showLauncher();
hideLauncher()
hideLauncher()
Hides the Frontnow Advisor launcher button.
Example usage:
advisor.hideLauncher();
sendMessage(message)
sendMessage(message)
Sends a message to the Frontnow Advisor.
Parameters:
message
(string
) - The message to send to the advisor.
Example usage:
advisor.sendMessage('How can I find the best city bike?');
stopMessage()
stopMessage()
Stops the current message loading in the Frontnow Advisor.
Example usage:
advisor.stopMessage();
updateTargetElement(
newTargetElement)
updateTargetElement(
newTargetElement)
Updates the target element for the Frontnow Advisor. This method is only applicable when using custom targeting.
Parameters:
newTargetElement
(HTMLElement
): The new HTML element to target.
Disclaimer:
This method should only be used if you are implementing custom targeting for the Frontnow Advisor. Ensure that the newTargetElement
parameter is a valid HTML element.
Example usage:
const newTarget = document.getElementById('custom-target');
if (newTarget) {
advisor.updateTargetElement(newTarget);
}
Notes:
The current advisor instance will close before updating the target element.
The
advisorContainer
will be removed and reinitialized to target the new element.
openNewChat()
openNewChat()
Opens a new chat in the Frontnow Advisor.
Example usage:
advisor.openNewChat();
Last updated
Was this helpful?