Skip to main content

Broadpeak

The PRESTOplay SDK for React Native is integrated with Broadpeak analytics service in the form of Broadpeak plugin.

Setup

First, install the @castlabs/react-native-prestoplay-broadpeak package:

npm install @castlabs/react-native-prestoplay-broadpeak

Once the plugin is installed, set its configuration and enable it when initializing the SDK, by passing the BroadpeakPlugin class. For example:

import { Sdk } from "@castlabs/react-native-prestoplay";
import {
BroadpeakPlugin,
StreamingSessionOptions,
StreamingSessionOptionsValues,
} from '@castlabs/react-native-prestoplay-broadpeak';

BroadpeakPlugin.setConfiguration ({
analyticsAddress: "analytics_url",
nanoCDNHost: "nano_cdn_host",
domainNames: "*",
streamingSessionOptions: {
[StreamingSessionOptions.SESSION_REPORTING_MODE]:
StreamingSessionOptionsValues.SESSION_REPORTING_MODE_METRICS_RECEIVER,
[StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY]: 7000,
[StreamingSessionOptions.SESSION_PRECACHE]: false,
},
logLevel: 'verbose',
})

Sdk.initialize({
licenseKey: /* Valid license here */,
plugins: [BroadpeakPlugin],
});

iOS

Add broadpeak repository to the application Podfile:

# broadpeak repository
source 'https://delivery-platform.broadpeak.tv/ios/broadpeak/specs.git'

Web

Add the Broadpeak SmartLib packages to your project dependencies:

"@broadpeak/smartlib": "5.0.1-4c69e21",
"@broadpeak/smartlib-analytics": "5.0.1-4c69e21",