Roku SDK: Setup & Initialisation
Overview
Section titled “Overview”The Secure Privacy Consent Management SDK provides Roku TV developers with an easy way to manage user consent within their applications. By integrating this SDK, you can ensure compliance with privacy regulations while giving users control over their data preferences.
Getting Started
Section titled “Getting Started”Obtain Your Application ID
Section titled “Obtain Your Application ID”To use the Secure Privacy SDK, you need an Application ID. Sign up for a free trial at Secure Privacy to get your Application ID.
Installation
Section titled “Installation”To begin using the Secure Privacy SDK for Roku, you need to copy the SDK files into your channel.
Roku has no package manager. Instead, you copy the SDK files into your channel’s source tree before packaging:
- Download the Secure Privacy Roku SDK.
- Copy the contents of the
sdk/source/directory into your channel’ssource/directory. - Copy the contents of the
sdk/components/directory into your channel’scomponents/directory. - Copy the images into your
images/directory.
The SDK files will be safely nested under a securePrivacy subfolder in both directories, preventing any collisions with your own channel’s files.
Initialization
Section titled “Initialization”To initialize the SDK, create the SPConsentEngine node, append it to your scene, and trigger the init action (typically in your main scene or app controller):
m.spEngine = CreateObject("roSGNode", "SPConsentEngine")m.top.AppendChild(m.spEngine)
m.spEngine.payload = { applicationId: "YOUR_APPLICATION_ID", secondaryApplicationId: "YOUR_SECONDARY_APPLICATION_ID"}m.spEngine.action = "init"This will set up the SDK and enable access to its features.
⚠️ The SDK operates as a session-bound engine. If you trigger the
clearSessionaction, you must reset your UI state and re-initialize the SDK before making further SDK calls.
Asset Configuration Note
Section titled “Asset Configuration Note”When configuring your Roku app on https://cmp.secureprivacy.ai
Please use PNG or JPG for the banner logo. SVG images are currently not supported by the SDK.
