@hotglue/widget
TypeScript icon, indicating that this package has built-in type declarations

1.4.93 • Public • Published

hotglue

@hotglue/widget

This package provide a React component in order to use the hotglue widget inside your web-app.

Installation

using npm

  npm install @hotglue/widget

or using yarn

  yarn add @hotglue/widget

Usage

  1. Include HotglueConfig as a HoC provider in your code. Provide it your public apiKey and envId, as shown below:
// src/index.js

import HotglueConfig from '@hotglue/widget'
import App from './App'

<HotglueConfig
  config={{
    apiKey: 'your-public-environment-api-key',
    envId: 'your-env-id',
  }}
>
  <App />
</HotglueConfig>
  1. Now you can launch the widget using the useHotglue hook:
// src/App.js

import { useHotglue } from '@hotglue/widget';

const App = (props) => {
  const { openWidget } = useHotglue();

  return <div>
    <button onClick={() => openWidget("test-user")}>Open widget</button>
  </div>
}

export default App

useHotglue hook

You can use the useHotglue hook to access several functions we export to help you implement a great user experience!

See the example below.

import { useHotglue } from '@hotglue/widget';

const App = (props) => {
  const { link } = useHotglue();

  const handleLink = () => {
    // Directly open widget to link the GitHub source
    link('test-user', 'nXqI5N1Ri', 'github');
  };

  return <button onClick={handleLink}>Link</button>;
};

export default App;

The useHotglue() hook currently supports the following functions:

  • link
  • setListener
  • reconnect
  • disconnect
  • createJob
  • getLinkedSources

To learn more about these functions, head to the widget docs.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.93331latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.93331
1.5.70
1.5.60
1.4.92688
1.5.522
1.5.40
1.4.911
1.5.31
1.4.903
1.4.8963
1.4.880
1.4.870
1.4.860
1.4.851
1.4.840
1.4.8315
1.4.820
1.4.810
1.4.800
1.4.7946
1.4.781
1.4.770
1.4.760
1.4.750
1.4.7456
1.4.730
1.4.720
1.4.710
1.4.700
1.4.690
1.4.680
1.4.670
1.4.661
1.4.651
1.4.641
1.4.630
1.4.620
1.4.610
1.4.600
1.4.590
1.4.580
1.4.570
1.4.560
1.4.550
1.4.540
1.4.530
1.4.520
1.4.510
1.4.500
1.4.490
1.4.480
1.4.460
1.4.450
1.4.440
1.4.430
1.4.420
1.4.410
1.4.400
1.4.391
1.4.380
1.4.3765
1.4.360
1.4.350
1.4.341
1.4.330
1.4.320
1.4.310
1.4.300
1.4.290
1.4.281
1.4.270
1.4.260
1.4.250
1.4.241
1.4.230
1.4.220
1.4.210
1.4.200
1.4.190
1.4.180
1.4.171
1.4.160
1.4.150
1.4.140
1.4.130
1.4.120
1.4.111
1.4.100
1.4.91
1.4.80
1.4.70
1.4.60
1.4.50
1.4.40
1.4.31
1.4.20
1.4.10
1.3.150
1.3.140
1.3.130
1.3.120
1.3.110
1.3.101
1.3.90
1.3.80
1.3.70
1.3.60
1.3.50
1.3.40

Package Sidebar

Install

npm i @hotglue/widget

Weekly Downloads

1,102

Version

1.4.93

License

none

Unpacked Size

4.8 MB

Total Files

13

Last publish

Collaborators

  • hassansyyid
  • ddasouza