Skip to main content
Note:If you are using the Frontend Modal, you must use our Frontend JavaScript SDK. For other presentation options such as the Embedded Link or Headless, the frontend JavaScript SDK is not required.
Our Frontend SDK makes it easy to get started with Embedded iPaaS. The Frontend SDK is used to render the Embedded iPaaS modal and manage workflow installations for your end users.

Installation

Install the package with npm:
Alternatively, you can install the SDK as vanilla JavaScript by adding the script tag to the header of your site:
HTML
When interacting with the Frontend Modal via vanilla JavaScript, you can access the Alloy library using the window object.

Setting Your Token

Before using any SDK methods, you must set your JWT token. As mentioned here, a JWT is required to securely authorize the user. Once you’ve retrieved your short-lived token from the Embedded APIs, set it in the frontend SDK using the setToken method:
JavaScript
All frontend SDK methods require that you first invoke setToken.

Rendering the Frontend Modal

To render the Alloy Modal for your user, call the install method. This displays the modal specific to the JWT you generated.

Standard Installation

The install method accepts the following parameters: Example: Installing all workflows in an integration
JavaScript
Example: Installing specific workflows
JavaScript"

Dynamic Configuration

In some cases, you may need to pre-fill values or dynamically configure workflows based on user-specific data. For example, if each of your users has a unique form with different fields, you can pass that data to Alloy to properly configure the workflow. When using dynamic configuration, the install method supports additional parameters: Pre-filled Values Structure Example: Installing workflows with dynamic configuration
JavaScript

Updating a Workflow

When a new workflow version is released that is newer than the currently installed version, you’ll want to prompt users to upgrade to the latest version.
Updating Workflows:You can tell when a workflow needs to be updated by comparing the payload returned from the List Integrations or List Workflows endpoints. When the version is greater than the installedVersion value, you should prompt the user to update their workflow.
To update a workflow, invoke the update method. This method allows you to update a workflow and accepts the same parameters as install. The update method does not accept an integrationId and only works with workflowIds.
JavaScript
Note that the update method does not allow you to specify a version to update to. Instead, it defaults to the most recently released version (as specified by the version key in the List Workflows endpoint).

Editing a Workflow

You may want to allow users to edit a workflow after they have installed it. For example, if your user installed a workflow that sends them a message in Slack every time an event happens, they might need to customize the “channel” parameter. Later, they may decide to change their selection. The edit method allows you to present the modal again so users can modify their configuration:
JavaScript
The edit method does not accept an integrationId and only works with workflowIds.

List all Workflows

You can list all workflows for a user by invoking the getWorkflows method:
JavaScript

List all Integrations

You can list all integrations for a user by invoking the getIntegrations method:
JavaScript

Deactivate a Workflow

You can deactivate a workflow by workflowId or name using the deactivate method:
JavaScript

Activate a Workflow

Similarly, you can activate (or reactivate) a workflow by its workflowId or name using the reactivate method:
JavaScript