@roku-sdk/ads 0.0.0-stage → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Roku, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # `@roku-sdk/ads`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > ⚠️ **Development Notice:** This package's interface may still change between releases. Pin the version and re-read the types after an upgrade.
4
+
5
+ Ad support for Roku SceneGraph TypeScript apps via the Roku Advertising Framework (RAF), across all three insertion modes:
6
+
7
+ | Mode | Command sequence | Needs |
8
+ | --- | --- | --- |
9
+ | **CSAI** — client-side insertion | `getAds` → `showAds` per break | `adView` + `contentView` |
10
+ | **SSAI** — server-stitched insertion | `getAds` → `stitchedAdsInit` | `contentView` |
11
+ | **CSAS** — client-side stitching | `getAds` → `constructStitchedStream` → `renderStitchedStream` | `adView` + `contentMetadata`; renders no app-owned `Video` |
12
+
13
+ `<Ads>` is a headless SceneGraph Task driven by writing props rather than by calling methods: wait for `onAdsState` to report `"ready"`, set the data fields, set `command` last, then read the result off the matching callback.
14
+
15
+ Every string result is cleared to `"none"` before its real value, so from the second command onwards each handler is called with that sentinel first — treat it as "no result yet". Only the first command hides it, because the field already holds `"none"` and writing a field the value it already has notifies nobody. The same comparison is why re-issuing a command with the value it already has does nothing at all.
16
+
17
+ Mid-roll needs no cue-point loop in the app — the task observes `contentView`'s position and calls RAF's `getAds` itself at each cue point, handing back the pods due now.
18
+
19
+ Requires `bs_libs_required: "roku_ads_lib"` in the app's `manifestEntries`; without it RAF never reports ready and every command is written into a void.
20
+
21
+ One worked example per mode lives in [`examples/ads`](../../examples/ads).
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@roku-sdk/ads",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.19.0",
4
+ "description": "Roku Advertising Framework (RAF) bridge for SceneGraph",
5
+ "main": "src/index.ts",
6
+ "exports": {
7
+ ".": "./src/index.ts"
8
+ },
9
+ "type": "module",
10
+ "files": [
11
+ "src/",
12
+ "dist/",
13
+ "tsconfig.json",
14
+ "README.md"
15
+ ],
16
+ "engines": {
17
+ "npm": ">=8.5.0",
18
+ "node": ">=24.0.0"
19
+ },
20
+ "dependencies": {
21
+ "@roku-sdk/components": "2.19.0",
22
+ "@roku-sdk/interfaces": "2.19.0",
23
+ "@roku-sdk/solid": "2.19.0",
24
+ "@roku-sdk/common": "2.19.0"
25
+ },
26
+ "devDependencies": {
27
+ "@jest/globals": "^30.2.0",
28
+ "@roku-sdk/dev-tools": "2.19.0"
29
+ },
30
+ "author": "Roku Inc",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://gitlab.com/rokudev/rsg-sdk.git",
35
+ "directory": "packages/ads"
36
+ },
37
+ "homepage": "https://gitlab.com/rokudev/rsg-sdk/-/tree/main/packages/ads#readme",
38
+ "bugs": {
39
+ "url": "https://gitlab.com/rokudev/rsg-sdk/-/issues"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "scripts": {
45
+ "test": "jest --passWithNoTests",
46
+ "coverage": "jest --coverage --runInBand --passWithNoTests --testTimeout=60000 --forceExit",
47
+ "clean": "rm -rf dist",
48
+ "lint": "eslint --no-error-on-unmatched-pattern \"src/**/*.{ts,tsx,mjs,cjs,js}\""
49
+ }
6
50
  }