manifest.toml to:
- Resolve compatible
@amazon-devices/*package versions. - Find JavaScript and TypeScript API usage that is unavailable on your minimum OS version.
- Find incompatible OmniKit Interface Definition Language (IDL) interface usage.
- Validate removed and deprecated APIs before you build.
- Generate OS version module metadata in the packaged app at build time.
Choose the OS versions your app supports
Set bothmin and target in manifest.toml.
For SDK 2.0, set both values to 2.0 (recommended):
minis the oldest OS version on which the app must install and run.targetis the newest OS version whose APIs and package profile the app builds against.
min is 1.2. OS 1.1 isn’t a valid value. Run vega project doctor if you’re unsure which versions are available.
Choose min
For SDK 2.0, setmin = "2.0" for new apps and for apps you migrate from an earlier SDK. All Vega devices in the field run OS 2.0, so an OS 2.0-only app reaches the same devices as an app with min = "1.2". With min and target both set to 2.0, you don’t need compatibility guards for OS 2.0 APIs, and you test against one OS version instead of two.
Setting min = "1.2" doesn’t reach more devices today. It adds work: you must guard every API introduced after OS 1.2, provide fallbacks, and test on both ends of the range.
In future SDK releases, devices in the field might run different OS versions. Then, base min on the oldest OS version that runs on the devices you want to support.
The following examples show how to apply this guidance:
-
A WebView app that uses no OS-specific APIs. Set
min = "2.0". A WebView app rarely depends on OS capabilities, sominhas little effect on how it runs, but2.0is still the recommended value for SDK 2.0. -
An app that uses an API introduced in OS 2.0. Set
min = "2.0". The API is available on every device your app supports, so you can call it without anisPresentOnOSguard. If you setmin = "1.2"instead, you must guard the call and provide a fallback for OS 1.2. For an example, see JavaScript and TypeScript compatibility lint.
Upgrade an existing app to target OS 2.0
From the app project root:--os-min 1.2 instead. For help choosing, see Choose min. Replace npm install and the build command with the package manager and build script your project uses.
vega project update-manifest writes the [os.version] values. In SDK 2.0 it also removes any OS version module entries it finds in the source manifest.toml. These are the reserved /com.amazon.vega.os@IVega_* family, and versioned @amzn/<pkg>@<version> and @amazon-devices/<pkg>@<version> module IDs. Removal is based on the module ID’s shape, not on whether you added it by hand or a tool generated it. Don’t re-add one of these IDs to work around the cleanup. On an application project, vega build inserts the required OS module metadata into the packaged manifest instead. On a native project, vega build writes these entries into your source manifest.toml. For details, see OS version module entries in a native project. Dependency module entries that don’t match these ID shapes are preserved.
Migrate from SDK 0.23 or earlier
Apps built with SDK 0.21, 0.22, or 0.23 don’t have an[os.version] section, because the section didn’t exist before SDK 0.24. Those SDK versions shipped with OS 1.1. Starting with SDK 0.24, the section is required, so when you build one of these apps with SDK 2.0, the build fails with a Missing [os.version] error until you add it.
Choose min for an app that ran on OS 1.1
OS 1.1 isn’t a validmin value. The lowest valid min is 1.2. For SDK 2.0, set min to 2.0. For the reasons, see Choose min.
Raising min above OS 1.1 doesn’t strand your existing users. Every device in the field that runs OS 1.1 is eligible to update to OS 2.0, and a device that hasn’t updated yet updates its OS before it updates your app.
Add the section and re-align your project
- Install SDK 2.0. For instructions, see Manage Your SDK Versions.
-
Commit your current
manifest.tomlandpackage.json, so you can review the changes that the next steps make. -
From the app project root, add the
[os.version]section, re-align your@amazon-devices/*dependencies, and confirm that the project is compatible:To support OS 1.2 as well, use--os-min 1.2instead. -
Build your app:
-
Review and commit the changes to
manifest.tomlandpackage.json.
Example manifest before and after
Amanifest.toml from an SDK 0.22 app has no [os.version] section:
vega project update-manifest --os-min 2.0 --os-version 2.0, the manifest has an [os.version] section:
JavaScript and TypeScript compatibility lint
Whenmin is lower than target, an API introduced after min might not exist on every supported device. SDK 2.0 checks source usage against the installed compatibility manifest.
The compatibility rules report the following.
For an app with
min = "1.2" and target = "2.0", guard an API that was added in OS 2.0:
if branch, a conditional expression, and a logical && expression. Avoid suppressing a finding unless another mechanism guarantees that the API is available.
If min and target are both 2.0, OS 2.0 APIs don’t require compatibility guards because the app doesn’t claim support for an older OS version.
Native compatibility lint
For projects withkepler.projectType set to native, vega project doctor also checks C and C++ sources.
It reports:
- Unguarded
TryQueryInterfaceusage for OmniKit interfaces added aftermin. - Interfaces removed before
minor deprecated bytarget.
TryQueryInterface<T>() result. A native OS-version check (for example #if __VEGA_OS_VERSION or VEGA_OS_MIN) isn’t a guard the lint recognizes, even though it might seem equivalent. Use an interface-existence check for an optional newer interface:
QueryInterface<T>() only for an interface guaranteed at min. Use TryQueryInterface<T>() and check for nullptr when the interface might be absent.
Suppress a native finding
To suppress a native finding that you have reviewed, add an// @os-version-ok comment. The native linter accepts it in two positions. These differ from the JavaScript and TypeScript rule, where the comment goes on the line above the import:
- At the end of the line of the call. This suppresses that call only.
- On its own line directly above the call.
- A comment placed two lines above the call.
- A comment that adds other text, such as
// do NOT add @os-version-ok here. - A misspelling, such as
@os-version-okay.
OS version module entries in a native project
On a native project (kepler.projectType set to native), vega build writes the OS version module entries into your source manifest.toml. A native build packages the source manifest and has no staging step. A native project is the only project type where these entries appear in your own manifest.toml.
When vega build writes the entries:
- It replaces them. It deletes each OS version module entry that doesn’t match the current
minandtarget, and then writes the correct entries. A change tominortargetdoesn’t leave an old entry in the file. - It’s idempotent. If the entries are already correct, the file doesn’t change.
- It runs after all the checks that can refuse the build. If
vega buildrefuses to build, yourmanifest.tomldoesn’t change.
Run the compatibility checks
Run:- To confirm each
isPresentOnOSguard evaluates tofalseand the app takes the fallback branch, test on theminOS version. - To confirm each
isPresentOnOSguard evaluates totrueand the app takes the OS 2.0 API branch, test on OS 2.0. - Confirm the app installs and starts on both versions.

