> ## Documentation Index
> Fetch the complete documentation index at: https://docs.titanos.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration to Titan SDK

If you’ve previously developed applications using the [DeviceInfo API](https://docs.titanos.tv/deviceinfoapi) for Philips TVs, migrating to the Titan SDK is the next step toward future-proofing your app for upcoming platforms.

This guide provides a clear path to update your code and ensure compatibility across the expanded Titan OS ecosystem.

## Why migrate to Titan SDK?

The legacy DeviceInfo API was limited:

* Brand-specific (Philips only)
* Restricted set of functionalities

The new Titan SDK offers significant advantages:

* **Unified Development:** Write your code once and run it consistently across all supported Titan OS-powered TVs.
* **New functionalities:** Gain access to features like Accessibility (Text-to-Speech, Text Magnification) and App Control.
* **Future-Proofing:** The Titan SDK will continue to evolve with new capabilities and updates, while the DeviceInfo API will not be maintained from now and removed by the end of the year.

## Step-by-Step Migration Guide

<Steps>
  <Step title="Remove Old DeviceInfo references">
    Remove any script references to the old DeviceInfo API from your `index.html` or build process to avoid accidental reliance on the deprecated object.
  </Step>

  <Step title="Install and import the Titan SDK">
    First, install the SDK from npm.

    ```bash theme={null}
    npm install @titan-os/sdk
    ```

    Then, import the `getTitanSDK` function into your project.

    ```javascript theme={null}
    import { getTitanSDK } from '@titan-os/sdk';

    const titanSDK = getTitanSDK();
    ```
  </Step>

  <Step title="Update Device and Capability Information">
    Replace all instances where you accessed properties directly from the global `DeviceInfo` object. Instead, use the asynchronous `titanSDK.deviceInfo.getDeviceInfo()` method.

    **Old Way:**

    ```javascript theme={null}
    // Old DeviceInfo API
    const modelYear = DeviceInfo.Product.year;
    const hasHDR = DeviceInfo.Capability.supportHDR;

    if (modelYear === "2023" && hasHDR) {
        // ...
    }
    ```

    **New Way:**

    ```javascript theme={null}
    // New Titan SDK
    const deviceInfo = await titanSDK.deviceInfo.getDeviceInfo();

    const modelYear = deviceInfo.Product.year;
    const hasHDR = deviceInfo.Capability.supportHDR_DV;

    if (modelYear === "2023" && hasHDR) {
        // ...
    }
    ```
  </Step>

  <Step title="Test Your Migrated Application">
    Thoroughly test your application on various TVs powered or maintained by Titan OS to ensure all functionalities work as expected post-migration. Pay close attention to:

    * All device information calls returning correct data.
    * Features that relied on old DeviceInfo properties.
    * New SDK features you've integrated.
  </Step>

  <Step title="Start integrating and exploring new features, such as Accessibility, App Control">
    With the Titan SDK integrated, begin exploring and implementing its new functionalities:

    * Accessibility: Utilize `titanSDK.accessibility.isTTSSupported()`, `titanSDK.accessibility.startSpeaking()`, `titanSDK.accessibility.onTTSSettingsChange()` and other methods as detailed in the [Accessibility Guide for TitanSDK Apps](\[https://docs.titanos.tv/accessibility]).
    * App Control: Leverage `titanSDK.apps.launch()` for streamlined app-to-app interactions.
    * Remote Control: Refer to the [Remote Control & Key Handling](\[https://docs.titanos.tv/navigation]) section for unified key mapping.
  </Step>
</Steps>

<Note>
  For projects not using a build system, a CDN-based integration is also available. Please refer to our CDN Integration Guide for more details.
</Note>

## Migration Map: DeviceInfo API → Titan SDK

Here is a mapping of common DeviceInfo API properties and their Titan SDK equivalents:

| Old `DeviceInfo` Property                        | New Titan SDK Equivalent (Function & Key)                                       | Notes & Example                                                                                                                                          |
| :----------------------------------------------- | :------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DeviceInfo.Channel.vendor`                      | `await titanSDK.deviceInfo.getDeviceInfo().Channel.vendor`                      | Retrieves the vendor name of the device.                                                                                                                 |
| `DeviceInfo.Channel.brand`                       | `await titanSDK.deviceInfo.getDeviceInfo().Channel.brand`                       | Retrieves the brand name of the device.                                                                                                                  |
| `DeviceInfo.Product.platform`                    | `await titanSDK.deviceInfo.getDeviceInfo().Product.platform`                    | Accesses the device's platform name.                                                                                                                     |
| `DeviceInfo.Product.year`                        | `await titanSDK.deviceInfo.getDeviceInfo().Product.year`                        | Retrieves the model year of the device. Example: `const info = await titanSDK.deviceInfo.getDeviceInfo(); console.log(info.Product.year);`               |
| `DeviceInfo.Product.deviceID`                    | `await titanSDK.deviceInfo.getDeviceInfo().Product.deviceID`                    | Retrieves the unique device identifier.                                                                                                                  |
| `DeviceInfo.Product.firmwareVersion`             | `await titanSDK.deviceInfo.getDeviceInfo().Product.firmwareVersion`             | Accesses the firmware version of the device.                                                                                                             |
| `DeviceInfo.Product.WhaleAdID`                   | `await titanSDK.deviceInfo.getDeviceInfo().Product.WhaleAdID`                   | Retrieves the advertising ID.                                                                                                                            |
| `DeviceInfo.Product.firmwareComponentID`         | `await titanSDK.deviceInfo.getDeviceInfo().Product.firmwareComponentID`         | Accesses the firmware component identifier.                                                                                                              |
| `DeviceInfo.Capability.os`                       | `await titanSDK.deviceInfo.getDeviceInfo().Capability.os`                       | Retrieves the operating system name.                                                                                                                     |
| `DeviceInfo.Capability.browserEngine`            | `await titanSDK.deviceInfo.getDeviceInfo().Capability.browserEngine`            | Accesses the browser engine used by the device.                                                                                                          |
| `DeviceInfo.Capability.hasStorage`               | `await titanSDK.deviceInfo.getDeviceInfo().Capability.hasStorage`               | Checks if the device has persistent storage.                                                                                                             |
| `DeviceInfo.Capability.support3d`                | `await titanSDK.deviceInfo.getDeviceInfo().Capability.support3d`                | Checks for 3D content support.                                                                                                                           |
| `DeviceInfo.Capability.supportUHD`               | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportUHD`               | Checks for Ultra High Definition (UHD) display support.                                                                                                  |
| `DeviceInfo.Capability.supportHDR`               | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportHDR`               | Checks for High Dynamic Range (HDR) display support. (Note: New TitanSDK also provides `supportHDR_HDR10` and `supportHDR_DV` for more specific checks.) |
| `DeviceInfo.Capability.supportWebSocket`         | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportWebSocket`         | Checks for WebSocket protocol support.                                                                                                                   |
| `DeviceInfo.Capability.supportPlayready`         | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportPlayready`         | Checks for Microsoft PlayReady DRM support.                                                                                                              |
| `DeviceInfo.Capability.supportWidevineModular`   | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportWidevineModular`   | Checks for Google Widevine Modular DRM support.                                                                                                          |
| `DeviceInfo.Capability.supportWidevineClassic`   | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportWidevineClassic`   | Checks for Google Widevine Classic DRM support.                                                                                                          |
| `DeviceInfo.Capability.supportClearKey`          | -                                                                               | This property does not appear in the new TitanSDK's capability response. Please verify if still needed or if there's an alternative.                     |
| `DeviceInfo.Capability.supportPrimetime`         | -                                                                               | This property does not appear in the new TitanSDK's capability response. Please verify if still needed or if there's an alternative.                     |
| `DeviceInfo.Capability.supportFairplay`          | -                                                                               | This property does not appear in the new TitanSDK's capability response. Please verify if still needed or if there's an alternative.                     |
| `DeviceInfo.Capability.supportAdobeHDS`          | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportAdobeHDS`          | Checks for Adobe HTTP Dynamic Streaming support.                                                                                                         |
| `DeviceInfo.Capability.supportAppleHLS`          | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportAppleHLS`          | Checks for Apple HTTP Live Streaming support.                                                                                                            |
| `DeviceInfo.Capability.supportMSSmoothStreaming` | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportMSSmoothStreaming` | Checks for Microsoft Smooth Streaming support.                                                                                                           |
| `DeviceInfo.Capability.supportMSSInitiator`      | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportMSSInitiator`      | Checks for Microsoft Smooth Streaming Initiator support.                                                                                                 |
| `DeviceInfo.Capability.supportMPEG_DASH`         | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportMPEG_DASH`         | Checks for MPEG-DASH streaming support.                                                                                                                  |
| `DeviceInfo.Capability.drmMethod`                | `await titanSDK.deviceInfo.getDeviceInfo().Capability.drmMethod`                | Retrieves the primary DRM method used by the device.                                                                                                     |
| `DeviceInfo.Capability.supportOIPF`              | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportOIPF`              | Checks for Open IPTV Forum (OIPF) support.                                                                                                               |
| `DeviceInfo.Capability.supportEME`               | `await titanSDK.deviceInfo.getDeviceInfo().Capability.supportEME`               | Checks for Encrypted Media Extensions (EME) support.                                                                                                     |

## Common Migration Scenarios & Troubleshooting

**Asynchronous Nature**: Remember that almost all interactions with the Titan SDK are asynchronous. Always use async/await or .then().catch() for proper handling of returned Promises.

**User Agent Differences**: While the SDK provides a unified interface, minor differences in the User Agent string might still exist between device brands. If your application relies on User Agent parsing, ensure it's robust enough to handle variations as detailed on the [https://docs.titanos.tv/user-agents](https://docs.titanos.tv/user-agents).

## Next steps

<CardGroup cols={2}>
  <Card title="Accessibility" icon="tv" href="/accessibility">
    Learn how to get started to the new accessibility functionalities in TitanSDK
  </Card>

  <Card title="About the new TitanSDK" icon="rectangle-code" href="/titan-sdk">
    Introduction to the new TitanSDK
  </Card>
</CardGroup>
