⚠️ This project has moved to github.com/braze-inc/braze-roku-sdk
Successful marketing automation is essential to the future of your mobile app. Braze helps you engage your users beyond the download. Visit the following links for details and we'll have you up and running in no time!
The Braze Roku SDK will provide you with an API to report information to be used in analytics, segmentation, and engagement,
- Add
BrazeSDK.brs
to your app in thesource
directory. - Add
BrazeTask.brs
andBrazeTask.xml
to your app in thecomponents
directory.
Add a reference to BrazeSDK.brs
in your main scene using the following script
element:
<script type="text/brightscript" uri="pkg:/source/BrazeSDK.brs"/>
Within main.brs
, set the Braze configuration on the global node:
globalNode = screen.getGlobalNode()
config = {}
config_fields = BrazeConstants().BRAZE_CONFIG_FIELDS
config[config_fields.API_KEY] = "YOUR_API_KEY_HERE"
config[config_fields.ENDPOINT] = "YOUR_ENDPOINT_HERE (e.g. https://sdk.iad-01.braze.com/)"
config[config_fields.HEARTBEAT_FREQ_IN_SECONDS] = 5
globalNode.addFields({brazeConfig: config})
Initialize the Braze instance:
m.BrazeTask = createObject("roSGNode", "BrazeTask")
m.Braze = getBrazeInstance(m.BrazeTask)
Braze should now be collecting data from your application. Please see our public documentation on how to log attributes, events, and purchases to our SDK. Our sample app's scene samplescene.brs
also contains examples of using the API.
The directory SceneGraphTutorial
contains the sample app (SceneGraphTutorial.zip) from Roku, with the Braze SDK integrated.