1.4.61 • Published 28 days ago

@hotglue/widget v1.4.61

Weekly downloads
-
License
-
Repository
-
Last release
28 days ago

@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.

1.4.61

28 days ago

1.4.60

1 month ago

1.4.59

1 month ago

1.4.58

1 month ago

1.4.57

1 month ago

1.4.56

1 month ago

1.4.55

1 month ago

1.4.54

2 months ago

1.4.53

2 months ago

1.4.51

2 months ago

1.4.52

2 months ago

1.4.50

2 months ago

1.4.49

3 months ago

1.4.48

3 months ago

1.4.46

4 months ago

1.4.45

4 months ago

1.4.44

4 months ago

1.4.43

4 months ago

1.4.42

5 months ago

1.4.41

5 months ago

1.4.22

10 months ago

1.4.24

9 months ago

1.4.23

9 months ago

1.4.26

8 months ago

1.4.25

8 months ago

1.4.28

8 months ago

1.4.27

8 months ago

1.4.29

8 months ago

1.4.31

8 months ago

1.4.30

8 months ago

1.4.33

7 months ago

1.4.32

7 months ago

1.4.35

7 months ago

1.4.34

7 months ago

1.4.37

7 months ago

1.4.36

7 months ago

1.4.39

5 months ago

1.4.38

6 months ago

1.5.2

7 months ago

1.5.1

7 months ago

1.5.0

7 months ago

1.4.40

5 months ago

1.4.20

12 months ago

1.4.21

12 months ago

1.4.9

1 year ago

1.4.11

1 year ago

1.4.10

1 year ago

1.4.13

1 year ago

1.4.12

1 year ago

1.4.15

1 year ago

1.4.14

1 year ago

1.4.17

1 year ago

1.4.16

1 year ago

1.4.19

1 year ago

1.4.18

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.3.15

2 years ago

1.3.14

2 years ago

1.3.13

2 years ago

1.3.12

2 years ago

1.3.11

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago