Using the hotglue widget with plain JavaScript
This page is a reference of all the functions accessible from the HotGlue
object exposed by the widgetv2.js
script.
After installing the widget using plain JavaScript, you can reference the HotGlue
(or window.HotGlue
) object and all the utility functions included in the widget.
HotGlue.open(user id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
options | objects | option objects |
Launches the hotglue widget for user with specified options.
HotGlue.close()
Closes the hotglue widget.
HotGlue.preload(user id, flow id)
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. |
Preloads the relevant user/flow data for usage with the HotGlue.link function.
HotGlue.link(user id, flow id, source, preloaded, options)
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 |
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 |
options | object | Object containing options to configure the form: json { "helperText": "Need help finding credentials? [Read the docs](https://docs.hotglue.xyz)" } |
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.
HotGlue.reconnect(user id, flow id, entity id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
flow id | string | ID of flow you wish to reconnect. Every flow in hotglue has an ID which can be found from the admin panel or API. source |
entity id | string | ID of source or target you wish to connect – typically just the name of the source in lowercase. Full catalog is accessible via API. Ex. salesforce |
options | object | Object containing options to configure the form: json { "isTarget": false } |
Used to reconnect an OAuth entities. Note for non-OAuth sources or targets, this will have no effect. In order to reconnect a target, you must pass the isTarget
parameter to the options
object.
HotGlue.disconnect(user id, flow id, entity id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
flow id | string | ID of flow you wish to disconnect. Every flow in hotglue has an ID which can be found from the admin panel or API source |
entity id | string | ID of source or target you wish to disconnect – typically just the name of the source in lowercase. Full catalog is accessible via API. Ex. salesforce |
options | object | Object containing options to configure the form: json { "isTarget": false } |
Used to disconnect an entity (source or target). Note you must pass the isTarget
parameter to the options
object if disconnecting a linked target.
HotGlue.setListener(listener)
Name | Type | Description |
---|---|---|
listener | object | Object containing all listeners. See list of available events below. |
ex. | ||
{onSourceLinked: (source, flow) => console.log(JSON.stringify(source))} |
Updates current listener configuration to specified listener object
HotGlue.getLinkedSources(flow id, user id)
Name | Type | Description |
---|---|---|
flow id | string | ID of flow to query |
user id | string | ID of user to query |
Returns a Promise which must be awaited or assigned a callback to extract relevant data
Convenience function wrapping the hotglue API to check if user has linked sources.
HotGlue.createJob(flowId, tenantId, startDate)
Name | Type | Required | Description |
---|---|---|---|
flowId | string | Yes | ID of flow |
tenantId | string | Yes | ID of user |
startDate | string (ISO date) | No | Optional. Used to override start date of the job. ex: 2022-10-16T00:00:00Z |
Returns a Promise which must be awaited or assigned a callback to extract relevant data
Convenience function wrapping the hotglue API to run a job for the user.
HotGlue.hasMounted()
Returns true
if the widget has mounted and is ready for use. false
otherwise.
List of available events in hotglue, which are passed as standard JavaScript functions.
Signature ()
Signature ()
Signature (id, flow_id)
Name | Type | Description |
---|---|---|
id | string | ID of source/target being linked |
flow id | string | ID of flow being linked |
Signature (target, flow_id)
Name | Type | Description |
---|---|---|
target | object | The target that has been linked. Follows same response structure as linked targets API |
flow id | string | ID of flow that has been linked |
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 |
Signature (tap, flow_id)
Name | Type | Description |
---|---|---|
tap | string | ID of source |
flow id | string | ID of flow |
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 |
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 |
Object specifying localization overrides for text in the widget.
Using the hotglue widget with plain JavaScript
This page is a reference of all the functions accessible from the HotGlue
object exposed by the widgetv2.js
script.
After installing the widget using plain JavaScript, you can reference the HotGlue
(or window.HotGlue
) object and all the utility functions included in the widget.
HotGlue.open(user id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
options | objects | option objects |
Launches the hotglue widget for user with specified options.
HotGlue.close()
Closes the hotglue widget.
HotGlue.preload(user id, flow id)
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. |
Preloads the relevant user/flow data for usage with the HotGlue.link function.
HotGlue.link(user id, flow id, source, preloaded, options)
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 |
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 |
options | object | Object containing options to configure the form: json { "helperText": "Need help finding credentials? [Read the docs](https://docs.hotglue.xyz)" } |
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.
HotGlue.reconnect(user id, flow id, entity id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
flow id | string | ID of flow you wish to reconnect. Every flow in hotglue has an ID which can be found from the admin panel or API. source |
entity id | string | ID of source or target you wish to connect – typically just the name of the source in lowercase. Full catalog is accessible via API. Ex. salesforce |
options | object | Object containing options to configure the form: json { "isTarget": false } |
Used to reconnect an OAuth entities. Note for non-OAuth sources or targets, this will have no effect. In order to reconnect a target, you must pass the isTarget
parameter to the options
object.
HotGlue.disconnect(user id, flow id, entity id, options)
Name | Type | Description |
---|---|---|
user id | string | ID of current user of your application. |
flow id | string | ID of flow you wish to disconnect. Every flow in hotglue has an ID which can be found from the admin panel or API source |
entity id | string | ID of source or target you wish to disconnect – typically just the name of the source in lowercase. Full catalog is accessible via API. Ex. salesforce |
options | object | Object containing options to configure the form: json { "isTarget": false } |
Used to disconnect an entity (source or target). Note you must pass the isTarget
parameter to the options
object if disconnecting a linked target.
HotGlue.setListener(listener)
Name | Type | Description |
---|---|---|
listener | object | Object containing all listeners. See list of available events below. |
ex. | ||
{onSourceLinked: (source, flow) => console.log(JSON.stringify(source))} |
Updates current listener configuration to specified listener object
HotGlue.getLinkedSources(flow id, user id)
Name | Type | Description |
---|---|---|
flow id | string | ID of flow to query |
user id | string | ID of user to query |
Returns a Promise which must be awaited or assigned a callback to extract relevant data
Convenience function wrapping the hotglue API to check if user has linked sources.
HotGlue.createJob(flowId, tenantId, startDate)
Name | Type | Required | Description |
---|---|---|---|
flowId | string | Yes | ID of flow |
tenantId | string | Yes | ID of user |
startDate | string (ISO date) | No | Optional. Used to override start date of the job. ex: 2022-10-16T00:00:00Z |
Returns a Promise which must be awaited or assigned a callback to extract relevant data
Convenience function wrapping the hotglue API to run a job for the user.
HotGlue.hasMounted()
Returns true
if the widget has mounted and is ready for use. false
otherwise.
List of available events in hotglue, which are passed as standard JavaScript functions.
Signature ()
Signature ()
Signature (id, flow_id)
Name | Type | Description |
---|---|---|
id | string | ID of source/target being linked |
flow id | string | ID of flow being linked |
Signature (target, flow_id)
Name | Type | Description |
---|---|---|
target | object | The target that has been linked. Follows same response structure as linked targets API |
flow id | string | ID of flow that has been linked |
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 |
Signature (tap, flow_id)
Name | Type | Description |
---|---|---|
tap | string | ID of source |
flow id | string | ID of flow |
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 |
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 |
Object specifying localization overrides for text in the widget.