Headless Tasks and Services

:exclamation: At this time, these feature integrations are available to select partners only.

The Vega SDK has support for headless tasks and services, which give you the ability to run JavaScript code in the background, separate from your app’s UI. Some feature integrations use them (Live TV, Content Personalization, Account Login). Headless tasks and services have their own React Native runtime, which has the constraints listed below.

  1. UI components and APIs aren’t allowed: You cannot import UI components or APIs (e.g. DeviceInfo, AppState, etc.) in a headless task or service. If you do (e.g. import { ImageBackground, Text, View, ViewStyle } from 'react-native')), the process will crash.

  2. Only specific modules and libraries are allowed: The headless runtime has a limited memory footprint and only supports specific modules and libraries. You can import from:

    • Standard utilities from ‘react-native’: Non-UI utilities like Platform and Dimensions can be imported using standard React Native imports
    • Vega-specific libraries: Packages like @amazon-devices/headless-task-manager, @amazon-devices/kepler-content-personalization, @amazon-devices/kepler-media-account-login, and others listed in the supported libraries documentation
    • Core JavaScript APIs: console.log, fetch, timers, promises, and global.performance.now

Examples

:white_check_mark: Safe - standard React Native non-UI utilities:

import { Platform, Dimensions } from 'react-native';

:white_check_mark: Safe - Vega-specific headless libraries:

import { HeadlessTaskManager } from '@amazon-devices/headless-task-manager';
import { ContentPersonalization } from '@amazon-devices/kepler-content-personalization';

:white_check_mark: Safe - core JavaScript APIs

console.log('Headless service started');
fetch('https://api.example.com/data');

:cross_mark: Will crash - UI components

import { View, Text, Image } from 'react-native';

:cross_mark: Will crash - UI-related APIs

import { AppState, DeviceInfo } from 'react-native';

:cross_mark: Will crash - imports everything including UI

import * as RN from 'react-native';`

The key principle: only import non-UI utilities from React Native and Vega-specific libraries listed in the supported modules documentation. Importing UI components or unsupported libraries will cause crashes.

If you see errors like, “Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DeviceInfo' could not be found” (you may have a different component name than ‘DeviceInfo’) in the logs, then you’re importing a UI component or UI-related API that isn’t available in the headless context. Review your imports and ensure you’re only importing non-UI utilities. Please review the troubleshooting steps to rootcause and resolve the issue.

Last updated: Feb 23, 2026