Widget

hotglue widget functions + API

open

Usage

HotGlue.open(user id, options)

Parameters

Name

Type

Description

user id

string

ID of current user of your application.

options

object

options object

Description

Launches the hotglue widget for user with specified options.

close

Usage

HotGlue.close()

Description

Closes the hotglue widget.

preload

Usage

HotGlue.preload(user id, flow id)

Parameters

Name

Type

Description

user id

string

ID of current user of your application.

flow id

string

ID of flow you wish to connect. Every flow in hotglue has an ID which can be found from the admin panel or API.

Description

Preloads the relevant user/flow data for usage with the HotGlue.link function.

link

Usage

HotGlue.link(user id, flow id, source, preloaded)

Parameters

Name

Type

Description

user id

string

ID of current user of your application.

flow id

string

ID of flow you wish to connect. Every flow in hotglue has an ID which can be found from the admin panel or API.

source

string

ID of source you wish to connect – typically just the name of the source in lowercase. Full catalog is accessible via API.

Ex. salesforce

preloaded

boolean

Mark this flag as true if you used the HotGlue.preload function to improve load time. Defaults to false

Description

If specified source is not linked, this will open a popup window for user to login

If specified source is linked, this will open the hotglue widget under specified flow so user can manage the source.

setListener

Usage

HotGlue.setListener(listener)

Parameters

Name

Type

Description

listener

object

Object containing all listeners. See list of available events below.

ex. {onSourceLinked: (source, flow) => console.log(JSON.stringify(source))}

Description

Updates current listener configuration to specified listener object

getLinkedSources

Usage

HotGlue.getLinkedSources(flow id, user id)

Parameters

Name

Type

Description

flow id

string

ID of flow to query

user id

string

ID of user to query

Response

Returns a Promise which must be awaited or assigned a callback to extract relevant data

[{
"tap": "salesforce",
"domain": "salesforce.com",
"label": "Salesforce",
"icon": "https://s3.amazonaws.com/other.hotglue.xyz/images/salesforce.svg",
"tap_url": "https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=...",
"auth_url": "https://login.salesforce.com/services/oauth2/token",
"type": "oauth",
"description": "Enable your customers to sync CRM data (Leads, Sales, etc.) directly from Salesforce using hotglue.",
"client_id": "...",
"fieldMap": {}
}]

Description

Convenience function wrapping the hotglue API to check if user has linked sources.

createJob

Usage

HotGlue.createJob(flow id, user id)

Parameters

Name

Type

Description

flow id

string

ID of flow

user id

string

ID of user

Response

Returns a Promise which must be awaited or assigned a callback to extract relevant data

{
"job_id": "lmaEbA",
"env_id": "dev.example-env.hotglue.xyz",
"job_name": "test_job:_V-vgdlLN",
"tenant": "default",
"started_by": "default",
"flow": "l8odS2mce",
"s3_root": "default/flows/l8odS2mce/jobs/lmaEbA",
"start_time": "2020-12-30T18:01:01.828266+00:00",
"state": {},
"tap": "quickbooks:sandbox",
"status": "ETL_FAILED",
"message": "ETL error...",
"last_updated": "2020-12-30T20:31:00.081282+00:00"
}

Description

Convenience function wrapping the hotglue API to run a job for the user.

Additional parameters

Detailed descriptions of parameters mentioned above are listed here.

options

All parameters in the options object are optional

Name

Type

Description

flow

string

Instead of showing list of flows, will open to this flow_id instead

demo

boolean

Launch in demo mode, which prevents linking/unlinking

filter

object

Object specifying any filters to apply

ex.

{flowFilter: (flow) => return flow.name === "Sales"}

listener

object

Object specifying any listeners to apply

ex.

{onSourceLinked: (source, flow) => console.log(JSON.stringify(source))}

listener

List of available events in hotglue, which are passed as standard JavaScript functions.

onSourceLinked

Signature (source, flow_id)

Name

Type

Description

source

object

The source that has been linked. Follows same response structure as linked sources API

flow id

string

ID of flow that has been linked

onSourceUnlinked

Signature (source, flow_id)

Name

Type

Description

source

object

The source that has been unlinked. Follows same response structure as linked sources API

flow id

string

ID of flow that has been unlinked

onStartJob

Signature (tap_id, flow_id, user_id)

Name

Type

Description

tap_id

string

ID of source the job is running for

flow_id

string

ID of flow source is linked under

user_id

string

ID of user who started job