Using the following method, you can run callback when a UserGuiding guide's step previewed;

window.userGuidingLayer.push({ 
  event: 'onPreviewStep',
  fn: _YOUR_FUNCTION_HERE_
})

example call

window.userGuidingLayer.push({
  event: 'onPreviewStep',
  fn: (data) => console.log(data)
})


example output
(logs to console)

{   
  guideId: 123456,
  stepIndex: 1
}

See other available methods;

onPreviewStart
onPreviewEnd

Did this answer your question?