Journey.js - Documentation - Public Functions

Below is a list of all the public API functions that can be called from a Journey.js service.

Download Now

v2.2.0 - 4th Sep 2024
Functions

Show/Hide:

start( group ):

Starts the Journey from the beginning.
Fires: onStart
Parameter: group: 'string' - The group of steps to use when starting the journey (defaults to "default").
Returns: 'Object' - The Journey.js class instance.

show( group ):

Shows the Journey.js dialog for the element in the last known position (defaults to the start).
Fires: onOpen
Parameter: group: 'string' - The group of steps to use when resuming a journey (defaults to the last group started).
Returns: 'Object' - The Journey.js class instance.

hide():

Hides the Journey.js dialog.
Fires: onClose
Returns: 'Object' - The Journey.js class instance.

isOpen():

Returns a flag that states if the dialog is opened.
Returns: 'boolean' - The flag that states if the dialog is open.

isComplete():

Returns a flag that states if the full journey has been completed.
Returns: 'boolean' - The flag that states if the full journey has been completed.



Managing Steps:

addDocumentSteps():

Finds all new elements that contain the binding attribute and adds them as new steps.
Fires: onAddStep
Returns: 'Object' - The Journey.js class instance.

addStep( element, options ):

Adds a new step to the journey for a specific element.
Fires: onAddStep
Parameter: element: 'Object' - The element that should be added to the journey.
Parameter: options: 'Object' - The options to use for this step in the journey (refer to "Options" documentation for properties).
Returns: 'Object' - The Journey.js class instance.

removeStep( element ):

Removes a step from the journey, or a hint.
Fires: onRemoveStep
Parameter: element: 'Object' - The element that should be removed.
Returns: 'Object' - The Journey.js class instance.

clearSteps( group ):

Removes all the steps from the journey.
Fires: onRemoveStep
Parameter: group: 'string' - States the group of steps you want to remove (defaults to all groups).
Returns: 'Object' - The Journey.js class instance.

clearHints():

Removes all the hints.
Returns: 'Object' - The Journey.js class instance.

reverseStepOrder():

RReverses the order the steps in the journey should in.
Returns: 'Object' - The Journey.js class instance.



Configuration:

setConfiguration( newOptions ):

Sets the specific configuration options that should be used.
Parameter: newOptions: 'Object' - All the configuration options that should be set (refer to "Configuration Options" documentation for properties).
Returns: 'Object' - The Journey.js class instance.



Additional Data:

getVersion():

Returns the version of Journey.js.
Returns: 'string' - The version number.