Initial SDK Integration

Installing the Braze Roku SDK will provide you with basic analytics and segmentation functionality.

Step 1: Add Files

Braze SDK files can be found in the sdk_files directory in the Braze Roku SDK repo.

  1. Add BrazeSDK.brs to your app in the source directory.
  2. Add BrazeTask.brs and BrazeTask.xml to your app in the components directory.

Step 2: Add References

Add a reference to BrazeSDK.brs in your main scene using the following script element:

1
<script type="text/brightscript" uri="pkg:/source/BrazeSDK.brs"/>

Step 3: Configure

Within main.brs, set the Braze configuration on the global node:

1
2
3
4
5
6
7
8
globalNode = screen.getGlobalNode()
config = {}
config_fields = BrazeConstants().BRAZE_CONFIG_FIELDS
config[config_fields.API_KEY] = "YOUR_API_KEY_HERE"
' example endpoint: "https://sdk.iad-01.braze.com/"
config[config_fields.ENDPOINT] = "YOUR_ENDPOINT_HERE"
config[config_fields.HEARTBEAT_FREQ_IN_SECONDS] = 5
globalNode.addFields({brazeConfig: config})

Step 4: Initialize Braze

Initialize the Braze instance:

1
2
m.BrazeTask = createObject("roSGNode", "BrazeTask")
m.Braze = getBrazeInstance(m.BrazeTask)

Basic SDK Integration Complete

Braze should now be collecting data from your application with the Braze Roku SDK. Please see the following sections on how to log attributes, events, and purchases to our SDK.

WAS THIS PAGE HELPFUL?
New Stuff!