Developer Hub
Advisor 3
Advisor 3
  • Introduction to Frontnow
  • Introduction
    • Getting started
    • Getting access to Frontnow
    • Glossary
  • Integration
    • Events
    • Methods
    • Styling
  • Policies
    • Data protection
Powered by GitBook
On this page
  • isReady()
  • open()
  • close()
  • showEoC()
  • closeEoC()
  • showLauncher()
  • hideLauncher()
  • sendMessage(message)
  • stopMessage()
  • updateTargetElement(newTargetElement)
  • openNewChat()

Was this helpful?

  1. Integration

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.

PreviousEventsNextStyling

Last updated 1 month ago

Was this helpful?

Before using these methods, ensure that the Frontnow Advisor has been properly initialized. For setup instructions, please refer to the page.

isReady()

Checks if the Frontnow Advisor is ready.

Returns:

  • boolean - true if the advisor is ready, otherwise false.

Example usage:

if (advisor.isReady()) {
    console.log('Advisor is ready!');
}

open()

Opens the Frontnow Advisor widget.

Example usage:

advisor.open();

close()

Closes the Frontnow Advisor widget.

Example usage:

advisor.close();

showEoC()

Opens the Frontnow "End of Conversation" widget.

Example usage:

advisor.showEoC();

closeEoC()

Closes the Frontnow "End of Conversation" widget.

Example usage:

advisor.closeEoC();

showLauncher()

Shows the Frontnow Advisor launcher button.

Example usage:

advisor.showLauncher();

hideLauncher()

Hides the Frontnow Advisor launcher button.

Example usage:

advisor.hideLauncher();

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()

Stops the current message loading in the Frontnow Advisor.

Example usage:

advisor.stopMessage();

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()

Opens a new chat in the Frontnow Advisor.

Example usage:

advisor.openNewChat();
Getting Started