Skip to content

Guides

Starts a guide for the current user. If another guide is playing, it stops and the requested guide starts.

type previewGuide = (
guideId: number,
options?: {
checkHistory?: boolean
initialStep?: number
},
) => void
guideIdnumberrequired

The guide ID, from the guide’s URL in the panel. Pass a number. The guide must be active in the container loaded on the page.

options.initialStepnumberdefault: 0

Zero based index of the step to start from. 0 is the first step, 1 the second, and so on.

options.checkHistorybooleandefault: false

When true, the guide only starts if the user matches its segments and its appearance frequency allows another showing. When false, it starts regardless of those rules.

window.userGuiding.previewGuide(1234)

Moves the active guide forward. Without an argument it goes to the next step. With a step index it jumps to that step. If the current step is the last one, the guide finishes.

type goToNextGuideStep = (stepIndex?: number) => void
stepIndexnumber

Zero based index of the step to go to. Defaults to the current step plus one.

window.userGuiding.goToNextGuideStep()

Stops the guide that is currently playing and removes it from the page.

type finishPreview = () => void
window.userGuiding.finishPreview()

Use onPreviewStart, onPreviewStep, onPreviewEnd, onPreviewComplete and onPreviewDismiss to react to guide progress.