Description

The HotglueConfig is a higher order component that must be included in order for the @hotglue/widget package to function correctly.

Usage

Since the HotglueConfig is a provider, it should be included near the entrypoint of your React app. Below is an example of including in the index.js of a create-react-app structure.

index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import HotglueConfig from '@hotglue/widget';

ReactDOM.render(
  <HotglueConfig
    config={{
      apiKey: 'your-public-environment-api-key',
      envId: 'your-env-id'
    }}
  >
    <App />
  </HotglueConfig>,
  document.getElementById('root')
);

Properties

config

The config property is an object which is used to connect to your hotglue environment. The object takes the following parameters:

NameDescriptionRequired
apiKeyYour public environment api keytrue
envIdYour environment id Usually something like dev.hotglue.acme.comtrue
optionsAn options objectfalse