Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Aliases, enums, and unions have some basic support, but are limited – for example, enums and unions which contain aliases will assume that the alias represents an Object. Enums and unions of strings or numbers are supported, but not of heterogeneous types. Generics are not supported.
Most basic TypeScript types are supported, in addition to some custom types such as Int32, Float, and ArrayBuffer. See the type mapping table for a full list.
When you run Codegen with the --new flag, it generates template files for your Turbo Module implementation. Existing implementations with the same name are preserved via the .bak extension in case you have in-progress or previous implementation code which you want to transfer into the new files. You can delete the backup files once you no longer need to reference their contents.
The basic idea of “converts TypeScript interface to native code template” is the same. There are differences in the exact set of types supported, since Vega’s native type support is not 1:1 with React Native, but they are similar. There are also differences in where it integrates with the build system and development process. React Native Codegen is still experimental, so there may be major changes in the future.
Separating the boilerplate specification from the human-provided implementation details allows codegen to confidently generate and re-generate the boilerplate without overriding anything important. This also allows us to enforce that the implementation matches the specification–the compiler requires the functions defined in the specification to be implemented.
If you do find yourself needing to modify the Spec files, be aware that re-running codegen will re-generate those files, overwriting your changes.
Vega Codegen currently only supports generating one module at a time. This is in order to better support customization options such as CLI flags for module names which may vary from module to module. That being said, your package can still contain multiple Turbo Modules, you will just need to run Codegen on them independently.

Common error messages

Optional arguments are not supported by Vega Turbo Modules. This is not a Codegen limitation, but a check introduced by Codegen. If your TypeScript interface has optional arguments (arg?: type), they should be required instead, as the Turbo Module will fail at runtime if the argument is not passed.
Optional arguments can be supported by JavaScript wrappers around the Turbo Module.
Most likely, you are importing types from another file. This is not supported by Codegen. We recommend movingg those types into the same file as the TypeScript interface. Certain types (Int32, Double, Float, etc.), can be imported from @amazon-devices/keplerscript-turbomodule-api and are supported by Codegen when imported that way.
Generics are not supported by Vega Turbo Modules.
any is not a supported type for Codegen. Consider using a stricter type definition. If you have a callback typed like (event: any) => void which actually accepts multiple types, you can use the CallbackParam type from @amazon-devices/keplerscript-turbomodule-api.
You need to install the package in your local workspace before you can run the script.

Last modified on September 30, 2025