@twilio/flex-ui-telemetry
v1.3.2
Published
Flex UI Telemetry SDK
Downloads
17,056
Readme
Flex Telemetry SDK for UI
Overview
This package is a light-weight wrapper on Segment Analytics SDK combined with the integration of the iframe implementation in Hosted Flex to overcome the challenge of having multiple Segment Analytics instances on a single browser window.
⚠️ Important Note:
This package is for Twilio internal use only and is not officially supported.
This package works only inside the Flex UI window where the iframe with the Segment AnalyticsJS + custom JS snippets exist which helps isolate the Flex Segment Analytics instance.
Usage
Installation
npm install @twilio/flex-ui-telemetry
Initialising the SDK
import FlexTelemetry from '@twilio/flex-ui-telemetry'
const analytics = new FlexTelemetry({
// common properties that you need to send with every event
// override the existing common properties that is supported by the sdk
pluginVersion: '1.0.0',
pluginName: 'plib-dialpad-conference-addon'
});
Page
analytics.page("Plugin Library Home", pageProperties, segmentOptions, callBack);
Track
analytics.track("Plugin Installation Start", eventProperties, segmentOptions, callBack);
Identify
analytics.identify(userId, traits, segmentOptions, callBack);
Group
analytics.group(groupId, traits, segmentOptions, callBack);