Skip to main content

SpiffCommerceClient

Functions

getWorkflowExperience(): Promise<WorkflowExperience>

Returns a promise that resolves to a WorkflowExperience object. This object contains all the information you need to render a workflow experience.

Example:

const experience = await client.getWorkflowExperience(
undefined, // Deprecated: workflowId
undefined, // Deprecated: workflowState
undefined, // Optional: previewServiceConstructor
{
integrationProductId: "0123456789",
workflowId: "0123456789",
type: "integration",
} // GetWorkflowOptions
);

Parameters:

NameTypeDescription
workflowIdstringDeprecated: The ID of the workflow to request an experience for.
workflowStatestringDeprecated: Serialized JSON string of the workflow state to initialize the experience with.
previewServiceConstructor(workflow: Workflow) => anyOptional: A constructor function that returns a PreviewService object. This object is used to render previews of the product.
optionsGetWorkflowOptionsAn object containing information to initialize the experience with.