Nami Public Documentation
Sign In
Nami Documentation
Nami Documentation
  • Get Started
    • Overview
      • Key Concepts
      • Data Collection
      • Built for Privacy
    • Evaluating Nami
    • SDKs
      • Apple Native SDK
      • Android Native SDK
      • Amazon Native SDK
      • Roku Native SDK
      • React Native Cross-Platform SDK
      • Flutter Cross-Platform SDK
      • Unity Cross-Platform SDK
      • Release Notes
        • Find Nami SDK Version
    • Quickstart Guide
  • Subscription Management
    • Overview
    • Products
      • Archive Products
      • Sync Products
    • Entitlements
    • Customer Screen
    • Accounts and Login/Logout
    • Advanced Use Cases
      • Upgrades and Downgrades
      • Supported Purchase Change States by Platform
      • Restoring Purchases
      • Working with Consumable IAPs
  • No Code Paywalls
    • Overview
    • Paywall Creator
      • Using the Creator
      • Paywall Layout
      • Components
        • Editing, Deleting, Reordering
        • Hiding Components
        • Video
        • Collapse
      • Editable Properties
        • Focused Styling
        • Safe Area
      • Conditions
        • Notched Devices
        • Product Entitlements
      • Adding Products
      • Repeating Product Group
      • Product Fields
      • Capabilities
        • Featured Styling
        • Selected Styling
        • Custom Brand Fonts
        • Carousel
        • Trial Eligibility
        • Deeplink Button
        • Introductory Offer Eligibility
        • Login Check
        • Product Groups
        • Conditional Product Groups
        • Offer Eligibility and Purchasing
        • Screenreader Text
        • Personalization Tokens
        • Custom Variables
        • Multipage
        • Custom Data Source
        • Advanced Video Features
        • Product Error States
      • ❓FAQs
        • Designing Paywalls in Figma
        • Guide to Building a Paywall from Scratch
      • 🎁Releases
        • Roadmap
    • Paywall Templates
      • Pacific
      • Pacific Premium
      • Trident
      • Starfish
      • Mantis
      • Venice
      • Venice Premium
      • Honest
      • Catalina
      • Oyster
      • Puffin
      • Marina
      • Beluga
      • Driftwood
      • Lagoon
      • Pisces
      • Aquarius
      • Conch
      • Lionfish
      • Moray
      • Tetra
      • Lighthouse
      • Puffin Tablet
    • Managing Paywalls
      • Archiving a Paywall
      • Duplicate a Paywall
    • Paywall Smart Text
    • Pricing Eligibility States
    • Pricing Eligibility by Platform
    • Nami Paywalls in Different Languages
    • Legacy Paywalls
  • Campaigns
    • Placements
      • Create a Placement
      • Deeplink Placements
      • Archiving a Placement
      • Managing Lots of Placements
      • Export Placements
    • Campaigns
      • Campaign Filters
        • Campaign Use Cases
      • Archiving a Campaign
      • Scheduling a Campaign
      • Campaign Conversion Events
      • Managing Lots of Campaigns
      • Campaign Troubleshooting
    • A/B and Multivariate Testing
      • Selecting an A/B test winner
      • A/B Test Allocation
  • Integrations
    • All Integrations
    • Billing Platforms
      • Apple Integration
        • App Store Setup
          • Privacy Details
        • Platform Integration
        • App Store Server Notifications
        • Store Credentials
          • App Store Connect Shared Secret
          • Apple App Store Connect API
          • Apple In App Purchase
        • Add a Product
        • Platform Sync
        • SDK Integration
        • Troubleshooting
        • Testing and Development
          • Apple Testing Environments
          • Setting up Device Sandbox Test Environment
          • Setting up StoreKit config in Xcode
      • Google Integration
        • Google Play Store Setup
        • Platform Integration
        • Service Account
        • Real-time Developer Notifications
        • Add a Product
        • Platform Sync
        • SDK Setup
        • Troubleshooting
          • Supporting Android minSdkVersion 25 or lower
          • Requested product is not available for purchase
          • Unsupported Version of Play Billing
      • Amazon Appstore Integration
        • Create Amazon Android App
        • Platform Integration
        • Shared Key
        • Real-time Event Notifications
        • Add a Product
        • SDK Integration
        • Testing
      • Roku Integration
        • Platform Integration
        • API Key
        • Transaction Notifications
        • Add a Product
        • SDK Integration
      • Web Integration
    • Analytics Tools
      • Adobe Analytics
      • Amplitude
      • Google Analytics
      • mParticle
      • 3rd-Party Analytics
    • Subscription Management
      • Nami Subscription Management
      • Bring your Own Payment Code
    • CDP Integrations
      • Adobe CDP Integration
      • Amplitude CDP Integration
      • Custom CDP Integration
      • Generic CDP Integration
    • Other Integrations
      • Wicket Labs
      • Webhooks
        • Introduction to the Nami ML Event System
        • Event Types
          • Purchase Status Updates
          • Events for Upgrades, Downgrades, and Crossgrades
        • Event Subscriptions
        • Understanding Transferred Events and Accounts
      • API Access
    • Events Feed
  • Analytics
    • Using Charts
    • Paywall Analytics
      • Impressions
      • Paywall Conversion Rate
      • Sessions
      • Active Devices
    • Subscription Analytics
      • Revenue
      • MRR
      • Purchases
      • Trial Starts
  • Nami Account
    • Manage your Apps
      • Find your Nami App Platform ID
      • Setting up Legal Text for your Apps
    • Organization
      • Configuring Organization Security Policies
      • Billing
    • Invite your Team
      • Roles
    • Manage your Account
      • Two-Factor Authentication (2FA)
Powered by GitBook
On this page
  • Demo app
  • Add the SDK to your channel
  • Configure the Nami SDK
  • Launch a Campaign to Raise a Paywall
  • Managing Identity
  1. Integrations
  2. Billing Platforms
  3. Roku Integration

SDK Integration

How to setup the Roku Nami SDK

Last updated 11 months ago

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:

  1. Add the SDK to your project

  2. Configure the Nami SDK

  3. Show a paywall

We'll run through each of these below.

Demo app

The provides a reference example for using the Nami Roku SDK.

Add the SDK to your channel

  1. Download the file from the GitHub repository. You can put it in the same level as application’s MainScene component file.

  2. 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" />

  3. Add a appData.json to your project if you don't have one, with the following keys.

{
  "namiSDKPath": "https://packages.namiml.com/NamiSDK/Roku/NamiRoku.pkg",
  "appPlatformIdProduction": "YOUR_PRODUCTION_APP_PLATFORM_ID",
  "appPlatformIdStaging": "YOUR_STAGING_APP_PLATFORM_ID",
  "environment": "production",
  "fonts": {
    "opensans_bold": "pkg:/source/fonts/opensans_bold.ttf",
    "opensans_regular": "pkg:/source/fonts/opensans_regular.ttf"
  }
}

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

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.

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.

' appPlatformId is set from the appData.json
appPlatformId = m.global.namiAppPlatformId

' Create NamiConfiguration object and configure it with required data
m.namiConfig = m.namiSDK.CreateChild("namiSDK:NamiConfiguration")
m.namiConfig.callFunc("configuration", appPlatformId)
m.namiConfig.logLevel = "debug"

m.nami =  m.namiSDK.CreateChild("namiSDK:Nami")
configureStatus = m.nami.callFunc("configure", m.namiConfig)

Launch a Campaign to Raise a Paywall

To show a paywall, launch a campaign.

m.scene = m.top.getScene()
m.namiSDK = m.scene.findNode("namiSDK")
m.namiCampaignManager = m.namiSDK.findNode("NamiCampaignManagerObj")
m.namiCampaignManager.unobserveField("campaignLaunchHandler")
m.namiCampaignManager.observeField("campaignLaunchHandler", "OnCampaignLaunchHandler")
m.namiCampaignManager.callFunc("launchWithLabel", "onboarding")

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

m.namiCustomerManager.callFunc("setCustomerDataPlatformId", "PASS_THE_USERS_CDP_ID_HERE")

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 as setup for Roku.

Each app will need a Roku integration . 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

Demo app
NamiSDKIntegrationHelper.brs
nami-roku
Nami Control Center > Integrations
setup