Skip to main content
Version: 1.5.11

Server

Install dependencies

Add the necessary dependencies to your project.

npm i @stackhouseos/flower-client-nodejs

Or

yarn add @stackhouseos/flower-client-nodejs

Add Flower to server

import FlowerJS from '@stackhouseos/flower-client-nodejs'
import flow from '../flow-server.json'

const components = {
api: () => [1,2,3,4],
save: () => true
}

const value = {foo:1}

FlowerJS({
components,
elements: flow.elements,
initialData: value,
autoNext: true,
responseAllData: false,
startId: undefined,
}).then(result => {
console.log(result)
})

ParamDescriptionoptionaldefault
componentsObject with the components you want to use within Flower
elementsArray with the elements you want to use within Flower
initialDataObject with the initial data you want to use within Flowertrue
autoNextBoolean to enable or disable the autoNext featuretruetrue
responseAllDataBoolean to send reponse responseAllData nodestrue
startIdString with the id of the element you want to start withtrue