Skip to main content
Plandalf is designed to be as low touch as possible. It should be able to run in the background and not require any manual intervention. However, there are some cases where you might want to interact with Plandalf programmatically.

Listen to events

plandalf.on('<EVENT_NAME>', () => {
    // callback is triggered when the checkout event happens
})
Events:
  • checkout-success - Triggered when a successful checkout happens
  • checkout-error - Triggered when a checkout error occurs

Fire a custom event

If you have configured your workflow listener to use custom triggers, you can fire a custom event using the following code:
plandalf.fireEvent('<CUSTOM_EVENT>')

Check if a workflow is active

Useful for fallback
plandalf.isWorkflowActive('<WORKFLOW_IDENTIFIER>')