LG webOS setup for the SofAds SDK
On webOS the SofAds SDK needs no permissions file and no allowlist. Include LG's webOSTV.js before the SDK so it can read your app ID, the TV model and, with the user's agreement, LGUDID, and let your app receive the BACK key.
Your webOS app ID
When you add an LG webOS listing, the dashboard asks for your webOS app ID. It is the id in your appinfo.json, in reverse-domain style, for example com.yourstudio.snowstrike. LG allows lowercase letters, digits, minus signs and periods, starting with a letter or digit; the ID can't start with com.palm, com.webos, com.lge or com.palmdts, and can't change once the app is published.
{ "id": "com.yourstudio.snowstrike" }The SDK reads the same ID on the TV with webOS.fetchAppId() from webOSTV.js (below), so there is nothing to pass, and sends it with every request. A listing with an ID only accepts traffic from that app, so copy it exactly. The store URL can wait until the app is live in the LG Content Store.
appinfo.json
LG requires id, title, type ("web"), main, icon and version (three numbers, no leading zeroes). SofAds adds nothing of its own. Set disableBackHistoryAPI to true so your app, and the ad overlay while it is visible, receive BACK (keyCode 461) instead of the platform handling it as browser history.
{
"id": "com.example.mytvgame",
"version": "1.0.0",
"vendor": "Example Studio",
"type": "web",
"main": "index.html",
"title": "My TV Game",
"icon": "icon.png",
"largeIcon": "largeIcon.png",
"disableBackHistoryAPI": true
}There is no domain allowlist in appinfo.json. If your app sets a Content Security Policy, allow https://*.sofadsrv.com for connect-src, img-src and media-src.
index.html and webOSTV.js
webOSTV.js is LG's library for calling webOS services. Download it from LG's developer site and ship it inside your package; the SDK uses it when it is there:
webOS.fetchAppId()andwebOS.fetchAppInfo(): your store app ID and version, sent with ad requests.webOS.deviceInfo(): the TV model and webOS version.- The luna service
luna://com.webos.service.sm, methoddeviceid/getIDs: LGUDID, on webOS 3.0 and later.
When you can skip it: without webOSTV.js the SDK still shows ads. It then uses its own install ID and the user agent, and your app ID is missing from reports. For a store build, include it.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My TV Game</title>
<!-- 1. LG's webOSTV.js, downloaded from LG and shipped in the package.
Use the folder name of the version you downloaded. -->
<script src="webOSTVjs-1.2.x/webOSTV.js"></script>
<!-- 2. The SofAds SDK, bundled in the package. -->
<script src="js/sofads.min.js"></script>
<!-- 3. Your app. -->
<script src="js/main.js" defer></script>
</head>
<body>
<canvas id="game" width="1920" height="1080"></canvas>
</body>
</html>The SDK uses XHR, not fetch, so packaged apps running from file:// work. The full API is in the SofAds SDK reference.
LGUDID needs the user's agreement
LG's documentation says you must get the user's agreement before calling the device ID API. The SDK only reads LGUDID when your consent setup allows advertising identifiers (for example, a TCF string with purpose 1, or consent.ads: true), and otherwise uses its own resettable install ID. LG does not offer a separate advertising ID.
// After your consent screen: the user agreed to personalized ads.
SofAds.setConsent({ ads: true });Google's PAL has an LG guide, but Google fully supports PAL only on Samsung Tizen. SofAds therefore enables Google demand on Tizen only for now; webOS apps need no Google-specific setup.
Privacy policy lines for webOS
Your app's privacy policy has to say that it shows ads and what data that involves. Copy these lines into it and adapt them to your app. They match the SofAds privacy policy, which is itself still a draft, so treat the wording as a template and have it reviewed for your app; it is not legal advice.
This app shows ads from SofAds. To choose, show and measure ads, the app sends SofAds information about the app and the TV (platform, manufacturer, model, operating system version, screen size and language), your IP address, your consent choices and an advertising identifier where your choices allow it. Where no TV advertising identifier is available or allowed, SofAds uses a random install ID stored by this app, which you can reset in the app's privacy settings. SofAds privacy policy: https://sofads.com/privacy/
On LG TVs, and only after you agree, the advertising identifier is the LG Unique Device ID (LGUDID). Without your agreement the app uses its own resettable install ID instead.
Next steps
Until your listing is live, your app gets test ads. Business details for the platform, from Paymentwall to app-ads.txt on LG, are in LG webOS monetization.
Frequently asked questions
Do I need webOSTV.js for SofAds?
Not to show ads, but include it in store builds. Without it the SDK can't read your app ID, the TV model or LGUDID and falls back to its install ID and the user agent.
Does webOS need an allowlist for the SofAds domains?
No. appinfo.json has no domain allowlist. Only a Content Security Policy of your own needs to allow the SofAds serving domain.
Is Google demand available on LG webOS?
Not through SofAds yet. Google fully supports its PAL library only on Samsung Tizen, so SofAds enables Google demand on Tizen only.
Sources
Checked on October 7, 2026. Platform rules change; when a source and this page disagree, the source wins.
- LG webOS TV Developer: appinfo.json
- LG webOS TV Developer: webOSTV.js introduction
- LG webOS TV Developer: Device unique ID (LGUDID)
- LG webOS TV Developer: Web app types
- Google PAL for CTV: Get started
- Google PAL: Get started on LG webOS
Keep reading
- Samsung Tizen setup: index.html and config.xml for Tizen.
- Test ads and test devices: what your app shows before its listing is live.
- LG webOS monetization: ads, Paymentwall, LGUDID and app-ads.txt on LG.