Smart Flows

Smart Flows module

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

ParamTypeDescription
flowSmartFlowSmart Flow to add

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

Add a new Smart Flow via shortCode

ParamTypeDescription
shortCodestringSmart Flow shortCode

SmartFlows.getActiveGlobalFlow() ⇒ SmartFlow | undefined

Get the currently active global flow

SmartFlows.getFlowById(flowId) ⇒ SmartFlow | undefined

Find a Smart Flow by ID

ParamTypeDescription
flowIdnumberSmart Flow ID

SmartFlows.getFlowByShortCode(shortCode) ⇒ SmartFlow | undefined

Find a Smart Flow by short code

ParamTypeDescription
shortCodestringSmart 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

ParamTypeDescription
componentIdstringThe ID of the component containing the modal
pageNumbernumberThe 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

ParamTypeDescription
componentIdstringThe ID of the component containing the modal
productIdstringThe product ID to navigate to

SmartFlows.handleLinkBasedFlow() ⇒ Promise<void>

Handle link-based Smart Flow initialization

SmartFlows.init(flows) ⇒ SmartFlowsModule

Smart Flow module initialization

ParamTypeDescription
flowsArray<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

ParamTypeDescription
flowIdnumberThe ID of the flow to remove

SmartFlows.runComponent(component, flow) ⇒ void

Executes a specific Smart Flow component

ParamTypeDescription
componentSmartFlowComponentExecute a component in the Smart Flow tree
flowSmartFlowSmart Flow being ran

SmartFlows.runFlow(flow) ⇒ void

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

ParamTypeDescription
flowSmartFlowSmart Flow to run

SmartFlows.setFlows(flows) ⇒ void

Apply the Smart Flows to make available

ParamTypeDescription
flowsArray<SmartFlow>Array of Smart Flows

SmartFlows.sync() ⇒ void

Sync the active UI component state