Device info

Static device properties and dynamic methods exposed by getDeviceInfo()

import {
    getDeviceInfo,
    useUiResolution,
    useDeviceInfoEvents,
} from "@roku-sdk/rsg-ts/runtime";

Access

Getter (synchronous):

getDeviceInfo(): DeviceInfoStatic | null

Returns a snapshot of static device properties and dynamic methods.

Each call returns a fresh object — safe to destructure and pass around. Static properties (model, locale, OS version, etc.) reflect the device state at call time and do not update reactively. For event-driven data (UI resolution changes, screensaver events, network status), use the dedicated hooks instead: useUiResolution(), useDeviceInfoEvents().

Returns null if the DeviceInfo runtime singleton is unavailable. The singleton lookup result, including null, is cached for the app's lifetime.

Hook (reactive): useUiResolution

useUiResolution(): { uiResolution: Accessor<UIResolution | null> }

Hook that delivers the device's current UI resolution once, at registration. Resolution-change notifications are not supported yet and will be available in a future OS build.

Returns an object with a uiResolution signal that holds a UIResolution value delivered synchronously when the handler is registered.

Example: useUiResolution

const { uiResolution } = useUiResolution();
// The resolution is delivered once, synchronously at registration.
// Resolution-change notifications will come in a future OS build.
// { name: "FHD", res: "fhd", width: 1920, height: 1080 }

Hook (reactive): useDeviceInfoEvents

useDeviceInfoEvents(): { internetStatus: Accessor<number>; linkStatus: Accessor<number>; lowGeneralMemory: Accessor<string | null>; screensaverExited: Accessor<number> }

Reactive hook that subscribes to device-level events: screensaver exit, network link status, low-memory warnings, and internet connectivity changes.

Each signal is a counter or nullable value that updates whenever the corresponding OS event fires. Use inside a SolidJS reactive context (component function or createEffect) to drive UI state.

An object with reactive signals:

  • screensaverExited: increments each time the screensaver exits.
  • linkStatus: increments each time the network link status changes.
  • lowGeneralMemory: "NORMAL" | "LOW" | "CRITICAL" | "UNKNOWN", or null before the first callback.
    The runtime calls the handler with "NORMAL" immediately on registration.
  • internetStatus: increments each time internet connectivity changes.

Example: useDeviceInfoEvents

const { screensaverExited, linkStatus, lowGeneralMemory, internetStatus } = useDeviceInfoEvents();
// screensaverExited() — counter, increments on each exit
// linkStatus()        — counter, increments on each link change
// lowGeneralMemory()  — "NORMAL" | "LOW" | "CRITICAL" | "UNKNOWN" | null
// internetStatus()    — counter, increments on each connectivity change

Methods

getRandomUUID

getRandomUUID(): string

Description

Returns a randomly generated UUID (version 4).

Each call produces a new unique identifier. Use for correlation IDs, session tokens, or any purpose requiring a unique string that does not need to be persisted across sessions.

Return values

A version 4 UUID string, e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479".

Example

// Returns a version 4 UUID string on each call, e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479"
const randomUUID = info?.getRandomUUID() ?? "(not available)";

Events

EventDescription
uiResolutionDelivered once at registration. Resolution-change notifications are not supported yet and will come in a future OS build. Subscribe via useUiResolution().
screensaverExitedincrements each time the screensaver exits.
linkStatusincrements each time the network link status changes.
lowGeneralMemory"NORMAL" | "LOW" | "CRITICAL" | "UNKNOWN", or null before the first callback. The runtime calls the handler with "NORMAL" immediately on registration.
internetStatusincrements each time internet connectivity changes.

Types

DeviceInfoStatic

Static device properties and dynamic methods exposed by getDeviceInfo().

This type is the subset of DeviceInfo that is safe to cache and pass around: it includes all static properties (model, locale, OS version, etc.) and the getRandomUUID() method, but excludes the event-handler setters — use the corresponding hooks (useUiResolution, useDeviceInfoEvents) for reactive data.

PropertyTypeDescription
apiVersionnumberVersion of the DeviceInfo runtime API (currently 0).
channelClientIdstringA UUID identifying this device for this channel. Changes if the account is relinked or in auto-sign-out (guest) mode.
currentLocalestringActive locale string combining language and region (e.g. "en_US", "fr_FR").
graphicsPlatformGraphicsPlatformTypeSee below.
isAutoSignOutModebooleantrue when the device is in auto-sign-out mode (shared/public device).
isRidaDisabledbooleantrue when the user has enabled Limit ad tracking. When true, rida returns a temporary ID.
modelstringModel identifier string (e.g. "4670X").
modelDetailsobjectAdditional model metadata. Shape varies by device.
modelDisplayNamestringHuman-readable model name (e.g. "Roku Express 4K+").
modelTypestringDevice class: "STB" for streaming sticks and boxes, "TV" for Roku TVs.
osVersionOsVersionParsed Roku OS version object. Use osVersion.major and osVersion.minor for comparisons.
ridastringRoku ID for Advertisers (UUID). Used for ad targeting and measurement. May be a random temporary ID if the user has enabled Limit ad tracking.
timezonestringDevice timezone string (e.g. "US/Eastern", "Europe/London").
userCountryCodestringChannel-store territory, usually an ISO 3166-1 alpha-2 code (e.g. "US"). See below.
videoModestringCurrent video output mode string (e.g. "1080p", "2160p60", "2160p60b10").

DeviceInfoStatic.graphicsPlatform

GPU/graphics backend identifier.

  • "opengl" — modern GL-based rendering pipeline (most devices)
  • "directfb" — legacy DirectFB pipeline (older low-end devices)

DeviceInfoStatic.userCountryCode

Channel-store territory, usually an ISO 3166-1 alpha-2 code (e.g. "US"). May instead be "OT" or a partner-store identifier. Defaults to "US" on unlinked devices without a configured territory (product locale/country defaults may override this). This is not the user's address country or physical location.

For account country, use the ChannelStore getUserData command and its IUserData.country result (@roku-sdk/components), not this field. BrightScript exposes this through GetUserRegionData.

OsVersion

Roku OS version components returned by DeviceInfo.osVersion.

PropertyTypeDescription
buildstringBuild identifier string.
majorstringMajor version number as a numeric string (e.g. "16").
minorstringMinor version number as a numeric string (e.g. "0").
revisionstringRevision number as a numeric string.

UIResolution

Normalized UI resolution delivered by useUiResolution().

Contains the OS resolution name, a normalized two-value res string for app logic, and the display dimensions in pixels.

PropertyTypeDescription
heightnumberPixel height of the display surface.
name"HD" | "FHD" | "SD" | "UNKNOWN"Raw resolution name from OS: "HD", "FHD", "SD", or "UNKNOWN"
res"hd" | "fhd"Normalized resolution for app use: only "hd" or "fhd". SD/UNKNOWN default to "fhd". Apps should not support SD mode. Resolution is known within one tick of app start.
widthnumberPixel width of the display surface.

UIResolutionRaw

Raw UI resolution event payload from the Roku OS runtime.

PropertyTypeDescription
heightnumberPixel height of the UI surface.
namenumberRaw resolution integer identifier from the OS.
widthnumberPixel width of the UI surface.

What’s Next

Did this page help you?