API Reference

Last updated 7 months ago

A list of available methods on the client-side JavaScript Appmixer SDK.

appmixer.api

Method

Description

appmixer.api.initialize(options)

Initialize the SDK. options.baseUrl must contain the URL of the Appmixer backend API.

appmixer.api.authenticateUser(username, password, callback)

Authenticate a user to Appmixer. Note that this can be a "virtual" user that exists for the sole purpose of associating a real user of your own product to a user in Appmixer. Each user in Appmixer can have a set of flows, can run and stop flows and can see data going through their flows. The callback(err, auth) is passed an error object as the first argument and an authentication object as the second. The authentication object contains token which you need to be able to make API calls to the Appmixer backend. If err.status === 403, the user does not exist in Appmixer.

appmixer.api.signupUser(username, password, callback)

Create a new user in Appmixer. The callback(err, auth) is passed an error object as the first argument and an authentication object as the second.

appmixer.api.setAccessToken(token)

Initialize the SDK with access token of a user. The access token must be set before using other API methods (except authenticationUser() and signupUser()).

appmixer.api.createFlow(descriptor, name, callback)

Create a new flow in Appmixer. The callback is of the form: callback(err, flowId).

appmixer.api.deleteFlow(flowId, callback)

Delete an existing flow identified by flowId. The callback is of the form: callback(err).

appmixer.api.getFlow(flowId, callback)

Get flow. The callback is of the form: callback(err, data), where data is an object with the following information: { id, flow, name, stage, btime, mtime, thumbnail }, where flow is the Flow Descriptor, stage is either 'running' or 'stopped', btime is the time the flow was created ("birth" time), mtime is the time the flow was modified and thumbnail contains a thumbnail image (self-contained, in the Data URI format).

appmixer.api.updateFlow(flowId, update, callback)

Update an existing flow. The callback is of the form: callback(err, flowId). update can contain the following information: { flow, name }.

appmixer.api.startFlow(flowId, callback)

Start a flow. The callback is of the form: callback(err, flowId).

appmixer.api.stopFlow(flowId, callback)

Stop a flow. The callback is of the form: callback(err, flowId).

appmixer.ui.FlowManager

The appmixer.ui.FlowManager is a UI widget that displays a list of flows the user created.

Method

Description

appmixer.ui.FlowManager(config)

Constructor function that accepts and config object. The config object must contain at least the el property that points to a container DOM element where the flow manager will be rendered. el can either be a CSS selector or a reference to a DOM element. Optionally, config.options object can be passed that disables/enables some of the visual features of the flow manager. You can toggle the following options on/off: toggleLayout, search.

open()

Render the flow manager inside its container.

close()

Close the flow manager.

on(event, handler)

React on events of the flow manager. See below for the list of events the flow manager supports.

Events

Event

Callback

flow:edit

function(flowId)

appmixer.ui.Designer

The appmixer.ui.Designer is a UI widget that displays a drag&drop Flow Designer.

Method

Description

appmixer.ui.Designer(config)

Constructor function that accepts config object. The config object must contain at least the el property that points to a container DOM element where the Designer will be rendered. el can either be a CSS selector or a reference to a DOM element.

open(flowId)

Render the Designer inside its container. The designer must always be opened for a certain flow identified by flowId.

close()

Close the designer.