Domless SDK API Reference: Difference between revisions

From Engineering Client Portal

(Created page with "==License== Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [https://engineeringportal.nielsen.com/wiki/Special:ClickThrough here], which must be accepted in order to d...")
 
(DOMles SDK API Reference Guide)
Line 1: Line 1:
==License==
==License==
Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [https://engineeringportal.nielsen.com/wiki/Special:ClickThrough here], which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).
Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [https://engineeringportal.nielsen.com/wiki/Special:ClickThrough here], which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).
==Overview==
The Nielsen DOM-less SDK provides APIs that allows our clients to integrate the Nielsen SDK in DOM-less environments, e.g., React Native, Node, etc.
==DOM-less SDK Initialization==
===Obtain the Nielsen Application ID (apid)===
The Nielsen <code>apid</code> is required to enable SDK functionality. Technical Account Manager will provide an apid for each player configuration. Browser SDK can support URLs that use any of the protocols – HTTPS and HTTP.
===Configure the DOM-less SDK===
====Installation====
Install with <code>npm install <nowiki>https://github.com/NielsenDigitalSDK/bsdk-domless</nowiki></code> and import the <code>BsdkInstance</code> into video player component
import { BsdkInstance } from 'bsdk-domless'
======status.ok()======
Initialization of the instance can be done with <code>status.ok()</code> function or use Promise handling approach
const instance = await new BsdkInstance(appID, instanceName, instanceMetadata, implementationHooks);
if (instance && instance.status.ok()) {
    expect(instance).not.toBe(undefined);
    expect(instance.status.ok()).toBe(true);
}
====Exposed Interface====
The exposed interface is as follows:
1. <code>`ggPM`</code> - method to send messages to the Nielsen SDK
2. <code>`processEvent`</code> - method to send app state to the Nielsen SDK, e.g., focus, blur, appclose
===Initialization Global Parameters===
{| class="wikitable"
|+
!'''Parameter'''
!'''Description'''
!'''Value'''
|-
|apid
|UniqueID assigned to player/site.
|'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
|-
|instanceName
|Name of SDK instance
|"any string value"
|-
|domlessEnv
|Type of Dom-less environment like ReactNative, Node, etc.
|"domlessEnv": "1", // For ReactNative
"domlessEnv": "2", // For Amazon
"domlessEnv": "3", // For NodeJS
“domlessEnv”: “4”, // For Custom
|-
|deviceId
|Device Identifier
|Alphanumeric string eg.
|-
|nol_sdkDebug
|Enables Nielsen console logging. Only required for testing
|"{nol_sdkDebug: "debug"})"
|-
|optout
|User optout status
|"true", "false"
|-
|hem_sha256
|SHA256-hashed email address (client-supplied unique 32-character hexadecimal string)
|"tMmiiTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
|-
|hem_sha1
|SHA1-hashed email address (client-supplied unique 32-character hexadecimal string)
|"XvBniTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
|-
|hem_md5
|MD5-hashed email address (client-supplied unique 32-character hexadecimal string)
|"JnIbdTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
|-
|uid2
|An identifier based on a user’s verifiable PII (e.g. hashed email). UID2.0 was initially created by The Trade Desk (TTD) and is now managed by Prebid.
|"MTKVpUAzwYAPnHrtfE0wlINOMzhU7UUEjjVdCdRu63k="
|-
|uid2_token
|Encrypted Unified ID 2.0
|"AgAAAAPFR0zA5ogv/yaAPiUsAdZPsfqS8Ql
DSGxAB+rr8yekFs3AjLYVk5qqqiyV2XHbSuwzHmxSlLeQeK QI1mp015jsNnpX5/xGgXldcgVz+gFnyh3T8/3agMwRmyrhC xG4oH2C7fc48AQk2eotE7FW0ZDEYM8fD9ZxDaxFUC/OV3OuZA&"
|-
|luid
|Living Unit ID - Experian Household ID
'''Note: This parameter is applicable only for CTV and First Party Livestream data'''
|"B0EOFEDgD"
|}
==DOM-less SDK API Methods & Properties==
{| class="wikitable"
|+
!Method/Property
!Event #
!DTVR
!DAR
!DCR
!Description
|-
|[[play (Browser)|play]]
|5
|✔
|✘
|✔
|Used when there is an ID3 fed product such as DTVR and the client does not want to send in all the CMS metadata that is sent in loadMetadata. This allows the client to send in at least the required “channel name” value associated to the ID3 feed. When the client passes in the channelName, they can change the CMS data stored by passing new values. If this event is not called then the “channel name” value populated will be the default value of “defaultChannelName”.
|-
|[[stop (Browser)|stop]]
|7
|✘
|✘
|✔
|Used when switching between ad and content or content and ad.
|-
|[[loadMetadata (Browser)|loadMetadata]]
|15
|✔
|✔
|✔
|Used when there is a preroll ad that needs to be associated with content metadata. The loadMetadata will first be called to populate the content metadata values and then the loadMetadata for ad metadata will be called. This allows sending a content ping with the ad info, even if the user bails out during the preroll ad.
|-
|[[setPlayheadPosition (Browser)|setPlayheadPosition]]
|49
|✘
|✘
|✔
|Used to send the playhead position.
|-
|[[sendID3 (Browser)|sendID3]]
|55
|✔
|✘
|✘
|Used to send the ID3 metadata.
|-
|[[end (Browser)|end]]
|57
|✔
|✘
|✔
|This is triggered 1) at the end of the content stream, 2) if the user switches to another piece of content 3) when the browser is refreshed or closed
|-
|[[setVolume (Browser)|setVolume]]
|61
|✔
|✘
|✔
|Used to pass in the player volume levels in %. Default value is -1.
|}

Revision as of 18:44, 31 July 2024

License

Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented here, which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).

Overview

The Nielsen DOM-less SDK provides APIs that allows our clients to integrate the Nielsen SDK in DOM-less environments, e.g., React Native, Node, etc.

DOM-less SDK Initialization

Obtain the Nielsen Application ID (apid)

The Nielsen apid is required to enable SDK functionality. Technical Account Manager will provide an apid for each player configuration. Browser SDK can support URLs that use any of the protocols – HTTPS and HTTP.

Configure the DOM-less SDK

Installation

Install with npm install https://github.com/NielsenDigitalSDK/bsdk-domless and import the BsdkInstance into video player component

import { BsdkInstance } from 'bsdk-domless'
status.ok()

Initialization of the instance can be done with status.ok() function or use Promise handling approach

const instance = await new BsdkInstance(appID, instanceName, instanceMetadata, implementationHooks);

if (instance && instance.status.ok()) {
    expect(instance).not.toBe(undefined);
    expect(instance.status.ok()).toBe(true);
}

Exposed Interface

The exposed interface is as follows:

1. `ggPM` - method to send messages to the Nielsen SDK

2. `processEvent` - method to send app state to the Nielsen SDK, e.g., focus, blur, appclose

Initialization Global Parameters

Parameter Description Value
apid UniqueID assigned to player/site. 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
instanceName Name of SDK instance "any string value"
domlessEnv Type of Dom-less environment like ReactNative, Node, etc. "domlessEnv": "1", // For ReactNative

"domlessEnv": "2", // For Amazon

"domlessEnv": "3", // For NodeJS

“domlessEnv”: “4”, // For Custom

deviceId Device Identifier Alphanumeric string eg.
nol_sdkDebug Enables Nielsen console logging. Only required for testing "{nol_sdkDebug: "debug"})"
optout User optout status "true", "false"
hem_sha256 SHA256-hashed email address (client-supplied unique 32-character hexadecimal string) "tMmiiTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
hem_sha1 SHA1-hashed email address (client-supplied unique 32-character hexadecimal string) "XvBniTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
hem_md5 MD5-hashed email address (client-supplied unique 32-character hexadecimal string) "JnIbdTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ="
uid2 An identifier based on a user’s verifiable PII (e.g. hashed email). UID2.0 was initially created by The Trade Desk (TTD) and is now managed by Prebid. "MTKVpUAzwYAPnHrtfE0wlINOMzhU7UUEjjVdCdRu63k="
uid2_token Encrypted Unified ID 2.0 "AgAAAAPFR0zA5ogv/yaAPiUsAdZPsfqS8Ql

DSGxAB+rr8yekFs3AjLYVk5qqqiyV2XHbSuwzHmxSlLeQeK QI1mp015jsNnpX5/xGgXldcgVz+gFnyh3T8/3agMwRmyrhC xG4oH2C7fc48AQk2eotE7FW0ZDEYM8fD9ZxDaxFUC/OV3OuZA&"

luid Living Unit ID - Experian Household ID

Note: This parameter is applicable only for CTV and First Party Livestream data

"B0EOFEDgD"

DOM-less SDK API Methods & Properties

Method/Property Event # DTVR DAR DCR Description
play 5 Used when there is an ID3 fed product such as DTVR and the client does not want to send in all the CMS metadata that is sent in loadMetadata. This allows the client to send in at least the required “channel name” value associated to the ID3 feed. When the client passes in the channelName, they can change the CMS data stored by passing new values. If this event is not called then the “channel name” value populated will be the default value of “defaultChannelName”.
stop 7 Used when switching between ad and content or content and ad.
loadMetadata 15 Used when there is a preroll ad that needs to be associated with content metadata. The loadMetadata will first be called to populate the content metadata values and then the loadMetadata for ad metadata will be called. This allows sending a content ping with the ad info, even if the user bails out during the preroll ad.
setPlayheadPosition 49 Used to send the playhead position.
sendID3 55 Used to send the ID3 metadata.
end 57 This is triggered 1) at the end of the content stream, 2) if the user switches to another piece of content 3) when the browser is refreshed or closed
setVolume 61 Used to pass in the player volume levels in %. Default value is -1.