as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Vega Codegen

The Turbo Module API package provides the Vega Codegen tool to simplify the code generation process. Vega Codegen generates native signatures and scaffolding code from a TypeScript interface definition of a Turbo Module.

Note: To avoid caching the packages globally, run npm install before running Codegen.

The following example shows how to run the tool.

Copied to clipboard.

npx @amazon-devices/keplerscript-turbomodule-api codegen src/js/src/NativeSampleTurboModule.ts \
    --new -o src/kepler/NativeModules

The tool offers the following options:

  • -n, --new: Writes implementation templates (and overwrites existing implementations with the same name). Existing files are saved with .bak extension.
  • -o, --outputPath: Specifies where to generate the native files.
  • -s, --namespace: The C++ namespace of your TurboModule. Defaults to myTurboModule.
  • -c, --className: The C++ class name used in the generated code. Defaults to match your TurboModuleRegistry call from the TypeScript interface.
  • -f, --outFile: The name to use to generate the file names. Defaults to match your TurboModuleRegistry call from the TypeScript interface.

After running the tool, you can add your implementations in src/kepler/NativeModules/SampleTurboModule.cpp.

For additional details on running the tool, see Vega Codegen FAQ. For example implementations with more complex types. see Advanced Turbo Module topics.


Last updated: Sep 30, 2025