HotglueConfig
HotglueConfig component reference
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.
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:
Name | Description | Required |
---|---|---|
apiKey | Your public environment api key | true |
envId | Your environment id Usually something like dev.hotglue.acme.com | true |
options | An options object | false |
Updated about 1 year ago