SDK Integration
How to setup the Roku Nami SDK
Please make sure you have completed the setup of your app on the Nami Control Center for all these steps to be successful.
Adding Nami to your Roku channel has a few steps:
Add the SDK to your project
Configure the Nami SDK
Show a paywall
We'll run through each of these below.
Demo app
The Demo app provides a reference example for using the Nami Roku SDK.
Add the SDK to your channel
Download the file NamiSDKIntegrationHelper.brs from the nami-roku GitHub repository. You can put it in the same level as application’s MainScene component file.
Include this file in MainScene component by pasting the following line in the script section of scene’s XML file:
<script type="text/brightscript" uri="NamiSDKIntegrationHelper.brs" />
Add a
appData.json
to your project if you don't have one, with the following keys.
It is optional to put NamiSDKIntegrationHelper.brs
file in the same level as the MainScene, however, if the path is different then make sure to edit the uri of the file in the above line.
Configure the Nami SDK
In the sample NamiSDKIntegrationHelper.brs
implementation, the Nami SDK is configured using the App Platform ID value(s) found in appData.json
To set up or find your Roku App Platform ID(s), see the the Nami Control Center > Integrations as setup for Roku.
Organizing Nami Instance for Production and Staging
If you want to segregate your Nami organization to have separate environment for Production and Staging, you can create two apps.
Each app will need a Roku integration setup. In this scenario, you will end up with two App Platform IDs for each environment that can be put in their respective keys in the appData.json
The NamiSDKIntegrationHelper.brs
selects the App Platform ID to use based upon the value of namiEnvironment
from appData.json
.
You can modify this behavior your specific environments by adjusting addData.json
and NamiSDKIntegrationHelper.brs
In addition, you can configure the SDK by setting some of the addition namiConfig
parameters.
Launch a Campaign to Raise a Paywall
To show a paywall, launch a campaign.
Managing Identity
Provide the Nami SDK your customer identifier for a user to link their devices for cross-platform entitlements, subscriber analytics, audience targeting, and more.
Login - link a device to a known customer identifier
Attach a user's identity when they register or signs-in to their account in your app.
Logout - unlink device from customer identifier
You can disconnect the association between a user's device and a customer identifier.
For example, do this when the user logs out of their account within your app.
If provided, the customer identifier will be returned in any individual level data from Nami web hooks or REST API in the external_id
field
Nami also uses customer id to establish a cross-platform view of a subscriber for analytics reporting.
Please note, the Nami service only accepts customer ids as strings matching the following formats: • Numeric • UUID • SHA256
Read about Accounts and Login/Logout
Set a CDP Identifier - link a device to a customer data platform identifier
Last updated