Skip to content

Smart Flows Methods

SmartFlows

Smart Flows module

SmartFlows.initialized : boolean

Smart Flows module initialization flag

SmartFlows.session : SmartFlowSession

Smart Flow Session module for session persistence and state management

SmartFlows.status : SmartFlowsStatus

Smart Flows module status. Helps determine when flows are ready to be processed.

'initializing' | 'redirecting' | 'ready'

SmartFlows.addFlow(flow) ⇒ void

Add a new Smart Flow

Param Type Description
flow SmartFlow Smart Flow to add

SmartFlows.addFlowByCode(shortCode) ⇒ Promise\<(SmartFlow|void)>

Add a new Smart Flow via shortCode

Param Type Description
shortCode string Smart Flow shortCode

SmartFlows.getActiveGlobalFlow() ⇒ SmartFlow | undefined

Get the currently active global flow

SmartFlows.getFlowById(flowId) ⇒ SmartFlow | undefined

Find a Smart Flow by ID

Param Type Description
flowId number Smart Flow ID

SmartFlows.getFlowByShortCode(shortCode) ⇒ SmartFlow | undefined

Find a Smart Flow by short code

Param Type Description
shortCode string Smart Flow shortCode

SmartFlows.getFlows() ⇒ Array\<SmartFlow>

Get a list of available flows

NOTE: Useful for filtering or lookups by ID / shortCode

SmartFlows.getPreviewFlow() ⇒ SmartFlow | undefined

Get the flow currently being previewed

SmartFlows.goToModalPage(componentId, pageNumber) ⇒ boolean

Navigate to a specific page in a modal for a given component ID

Returns: boolean - True if successful, false otherwise

Param Type Description
componentId string The ID of the component containing the modal
pageNumber number The page number to navigate to (1-based)

SmartFlows.goToModalProduct(componentId, productId) ⇒ boolean

Navigate to a specific product page in a modal for a given component ID

Returns: boolean - True if successful, false otherwise

Param Type Description
componentId string The ID of the component containing the modal
productId string The product ID to navigate to

SmartFlows.handleLinkBasedFlow() ⇒ Promise\<void>

Handle link-based Smart Flow initialization

SmartFlows.init(flows) ⇒ SmartFlowsModule

Smart Flow module initialization

Param Type Description
flows Array\<SmartFlow> Array of Smart Flows to initialize

SmartFlows.processFlows() ⇒ void

Process all available Smart Flows

SmartFlows.removeFlow(flowId) ⇒ void

Removes a flow + cleans up associated component observers

Param Type Description
flowId number The ID of the flow to remove

SmartFlows.runComponent(component, flow) ⇒ void

Executes a specific Smart Flow component

Param Type Description
component SmartFlowComponent Execute a component in the Smart Flow tree
flow SmartFlow Smart Flow being ran

SmartFlows.runFlow(flow) ⇒ void

Run a given Smart Flow, traversing its tree and rendering the first components

Param Type Description
flow SmartFlow Smart Flow to run

SmartFlows.setFlows(flows) ⇒ void

Apply the Smart Flows to make available

Param Type Description
flows Array\<SmartFlow> Array of Smart Flows

SmartFlows.sync() ⇒ void

Sync the active UI component state