Description
TheuseHotglue is the primary way of using the @hotglue/widget package outside of the inline Connections component. Use this to launch the widget and access utility functions.
Usage
First you must include theHotglueConfig provider as a higher order component in your React app. For example, in index.js:
index.js
useHotglue hook anywhere, as shown below:
App.js
Functions
Below is a reference of all of the currently supported functions from theuseHotglue hook.
openWidget
Opens the widget for a user with options.Usage
HotGlue.openWidget(user id, options)
Parameters
link
Usage
HotGlue.link(user id, flow id, source, preloaded, options)
Parameters
Description
If specifiedsource 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.
reconnect
Usage
HotGlue.reconnect(user id, flow id, entity id, options)
Parameters
Description
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 theisTarget parameter to the options object.
disconnect
Usage
HotGlue.disconnect(user id, flow id, entity id, options)
Parameters
Description
Used to disconnect an entity (source or target). Note you must pass theisTarget parameter to the options object if disconnecting a linked target.
setListener
Usage
HotGlue.setListener(listener)
Parameters
Description
Updates current listener configuration to specified listener objectcreateJob
Usage
HotGlue.createJob(flowId, tenantId, startDate)
Parameters
Response
JSON
Description
Convenience function wrapping the hotglue API to run a job for the user.close()
Usage
Description
Closes the hotglue widget.setOptions
Usage
Parameters
Description
Updates the current widget configuration with new options. This function allows you to widget behavior globally. The options object can contain any of the supported widget configuration parameters.Available Options
Theoptions parameter accepts an object with the following properties:
Example
setSchema
Usage
Parameters
Description
Enables the custom mapping component and sets the source schema for the widget at runtime when using@hotglue/widget in React. Use this to define the fields your users map from before opening the widget.
When enforceOneToOneMapping is true, each source field can only map to one target field, preventing duplicate mappings in the UI.
For full schema structure details, see custom field mapping.