SDK Documentation

Prev Next

setToken

Sets the token for the end user's authentication and interaction with the SDK.

Arguments

  • token (string) – The end user token fetched from the backend

Example

mindCloud.setToken(token);

getTokenExpiration

Returns a Date object with the token’s expiration, or null if there is no token

Example

const expiresIn = mindCloud.getTokenExpiration();
if (!expiresIn || (expiresIn.getTime() - Date.now()) < 60 * 1000) {
  const { token } = await fetchUserToken(userId); // get a refreshed token from your backend
  mindCloud.setToken(token);
}

getIntegrations

Lists all available integrations with their respective installations for that end user.

Example

const integrations = await mindCloud.getIntegrations();
console.log(integrations);

// Result
[
  {
    "id": "int_SLACK_001", // integrationId
    "appId": "slk_12345ABCDE",
    "appName": "Slack",
    "companyId": "cmp_98765ZYXWV",
    "description": "Slack Messaging Platform",
    "iconUrl": "https://cdn.iconscout.com/icon/free/png-256/slack-226533.png",
    "isInstalled": true,
    "name": "Slack Integration",
    "createdOn": "2025-09-08T22:55:13.978Z",
    "updatedOn": "2025-09-08T22:55:14.718Z",
    "installations": [
      {
        "id": "install_123XYZ", // installationId
        "integrationId": "int_SLACK_001",
        "isInstalled": true,
        "createdOn": "2025-09-09T02:36:29.984122+00:00",
        "apps": [
          {
            "appId": "slk_12345ABCDE",
            "name": "Slack",
            "slug": "slack",
            "iconUrl": "https://cdn.iconscout.com/icon/free/png-256/slack-226533.png",
            "isConnected": true
          }
        ],
        "workflows": [
          {
            "id": "wf_67890",
            "name": "Send Slack Notification",
            "isInstalled": true, // enabled or disabled
            "arguments": {}
          }
        ]
      }
    ]
  }
]

install

Opens the installation modal for the end user to install an integration.

Arguments

An object with:

  • integrationId (string) – ID of the integration

Example

mindCloud.install({ integrationId: 'int_SLACK_001' });

modify

Opens the modal in edit mode for a specific installation.

Arguments

An object with:

  • installationId (string) – ID of the installation

Example

mindCloud.modify({ installationId: 'install_123XYZ' });

uninstall

Uninstalls a specific installation. This is good for when the user just wants to switch off an installation along with all it's workflows.

Arguments

An object with:

  • installationId (string) – ID of the installation

Example

mindCloud.uninstall({ installationId: 'install_123XYZ' });

reinstall

Reinstalls a specific installation.

Arguments

An object with:

  • installationId (string) – ID of the installation

Example

mindCloud.reinstall({ installationId: 'install_123XYZ' });

enableWorkflow

Enables a specific workflow inside an installation.

Arguments

An object with:

  • workflowId (string) – ID of the workflow

  • installationId (string) – ID of the installation

Example

mindCloud.enableWorkflow({ workflowId: 'wf_67890', installationId: 'install_123XYZ' });

disableWorkflow

Enables a specific workflow inside an installation.

Arguments

An object with:

  • workflowId (string) – ID of the workflow

  • installationId (string) – ID of the installation

Example

mindCloud.disableWorkflow({ workflowId: 'wf_67890', installationId: 'install_123XYZ' });