Skip to content

Roku SDK: Setup & Initialisation

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.

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.

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:

  1. Download the Secure Privacy Roku SDK.
  2. Copy the contents of the sdk/source/ directory into your channel’s source/ directory.
  3. Copy the contents of the sdk/components/ directory into your channel’s components/ directory.
  4. 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.

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 clearSession action, you must reset your UI state and re-initialize the SDK before making further SDK calls.

👉 See Session Lifecycle & Reinitialization.

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.