Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/setup/store/amazon and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.
My request: [describe what customers should be able to do]Amazon Store Setup
Amazon distributes apps to two different device families, and OpenIAP treats them as two separate targets. Fire OS is Amazon's Android-based OS (Fire TV, Fire tablets): an Amazon Appstore build is a regular Android build that selects the amazon Gradle flavor. Vega OS is Amazon's newer, non-Android OS: its apps run on the Kepler JavaScript runtime and are built with React Native for Vega (or a compatible Expo Vega build), so Vega is a separate project target rather than an Android flavor.
Target Model#
OpenIAP selects each Amazon target through a different mechanism — a Gradle flavor for Fire OS, a runtime-selected adapter for Vega OS:
| Target | Runtime | OpenIAP selection |
|---|---|---|
| Fire OS | Android / Amazon Appstore SDK | Android amazon flavor and openiap-google-amazon. |
| Vega OS | Amazon Kepler JavaScript runtime | Runtime-selected kepler adapter in expo-iap or react-native-iap. |
Required Values#
Fire OS and Vega OS both validate through Amazon receipts, but their app metadata is configured in different places. App Tester refers to Amazon App Tester, Amazon's sideloaded sandbox app for exercising test purchases on device.
| Value | Fire OS | Vega OS |
|---|---|---|
| App identity | Android applicationId. This should match the package registered in Amazon Developer Console. | Vega manifest.toml [package].id and interactive component id. |
| Display metadata | Normal Android app label and icon from the app manifest and resources. | Vega title, appName, and icon. In Expo these default from the Expo config unless optional android.amazon.vegaOS overrides are provided. |
| Products | Amazon Developer Console product ids and Amazon App Tester catalog entries. Keep them identical to app SKUs. | Amazon Vega product ids and App Tester data. Keep the same SKU strings used by fetchProducts and requestPurchase. |
| Amazon public key | Required by Amazon Appstore SDK integrations. Put the public key where the Android app's Amazon setup expects it, usually under app assets for Fire OS builds. | Not an Android asset path. Vega uses Kepler runtime services and the Vega app manifest/module declarations. |
| Verification payload | iapkit.amazon.receiptId; optional userId and expectedProductId; plus sandbox for App Tester. | Same iapkit.amazon payload. The Vega adapter can resolve Amazon user data when the runtime returns it. |
Framework Setup#
The table below summarizes how each framework selects an Amazon target; the Fire OS and Vega OS sections that follow contain the full configuration.
| Framework | Fire OS | Vega OS |
|---|---|---|
| Native Android | The OpenIAP Gradle plugin: a connected Fire device on a debug build; openiapStore=amazon or fireOsEnabled=true pins it. | Not a Kepler target. |
| Expo | A debug build follows the connected Fire device. modules.amazon.fireOS declares Fire OS, and ORG_GRADLE_PROJECT_openiapStore=amazon pins it; either wins over the device. android.amazon.appstoreKey supplies the public key. | Auto-detected from the manifest.toml Vega target marker unless modules.amazon.fireOS declares Fire OS; modules.amazon.vegaOS forces it on or off, with optional android.amazon.vegaOS metadata overrides. |
| React Native | Resolved at build time by the shared Gradle resolver; openiapStore=amazon or fireOsEnabled=true pins it. | Separate React Native for Vega target with Kepler dependencies and manifest.toml. |
| Flutter | Resolved at build time by the shared Gradle resolver; openiapStore=amazon or fireOsEnabled=true pins it. | No Vega runtime target. |
| KMP | The OpenIAP Gradle plugin, as for native Android. | No Vega runtime target. |
| MAUI | A connected Fire device on a Debug build; OpenIapStore=amazon pins it. | No Vega runtime target. |
| Godot | Left at auto, a debug export follows a connected Fire device; for release, set openiap/android_store to amazon. | No Vega runtime target. |
Fire OS#
Fire OS artifacts link the Amazon Appstore SDK and resolve purchases through the Android amazon flavor. Every Fire OS build also needs the Amazon public key: download AppstoreAuthenticationKey.pem for the app from the Amazon Developer Console and ship it in android/app/src/main/assets. The SDK verifies receipts with it, and it is inert on every other store, so it stays in the project permanently.
Native Android#
Depend on openiap-google and apply the OpenIAP Gradle plugin; it links openiap-google-amazon instead when a debug build finds a Fire device, or when openiapStore=amazon or fireOsEnabled=true pins a release.
// settings.gradle.kts — keep mavenCentral() in pluginManagement.repositories
plugins {
id("io.github.hyochan.openiap") version "3.6.3"
}
// app/build.gradle.kts
dependencies {
implementation("io.github.hyochan.openiap:openiap-google:3.6.3")
}Expo#
Expo apps keep the Amazon public key in the config plugin; the plugin copies it into android/app/src/main/assets on every prebuild. A local debug build follows the connected Fire device. An EAS build has no device to follow and a release build never looks, so pin every EAS profile that builds for Fire OS with ORG_GRADLE_PROJECT_openiapStore=amazon in its env, or set modules.amazon.fireOS: true in the plugin config. Either wins over the connected device.
{
"build": {
"fire": {
"env": { "ORG_GRADLE_PROJECT_openiapStore": "amazon" }
}
}
}plugins: [
[
'expo-iap',
{
android: {
amazon: {
appstoreKey: './AppstoreAuthenticationKey.pem',
},
},
},
],
]modules.amazon.fireOS also turns off Vega auto-detection. A static true would skip the Vega files for the Vega build too, so a root that builds both sets it from the Fire profile's pin in app.config.ts.
plugins: [
[
'expo-iap',
{
modules: {
amazon: {
fireOS: process.env.ORG_GRADLE_PROJECT_openiapStore === 'amazon',
},
},
},
],
]React Native#
react-native-iap picks the store itself when Gradle runs, so the app only needs the key: place AppstoreAuthenticationKey.pem in android/app/src/main/assets. A connected Fire device on a debug build, an amazon flavor, -PopeniapStore=amazon, or -PfireOsEnabled=true then selects Amazon, exactly as for Horizon OS.
Flutter#
flutter_inapp_purchase picks the store itself, so the app only needs the key in android/app/src/main/assets; pin a release build with ORG_GRADLE_PROJECT_openiapStore=amazon flutter build apk, or with fireOsEnabled=true.
KMP and MAUI#
KMP apps apply the same plugin in settings.gradle.kts, which links kmp-iap's Amazon build. A MAUI Debug build follows a connected Fire device; pin a release with the MSBuild property. Every MAUI build also carries the libraries the other stores need (MAUI Setup). The public key goes in the Android app's assets: a KMP app's src/androidMain/assets, or a MAUI app's Platforms/Android/Assets.
dotnet publish -f net10.0-android -c Release -p:OpenIapStore=amazonA Godot export picks Amazon from a connected Fire device on a debug export, or from openiap/android_store=amazon. Put AppstoreAuthenticationKey.pem at the project root and add it to the Android preset's filter for non-resource files; the export packs it into the APK's assets, where the SDK reads it.
Vega OS#
Vega OS is not an Android flavor. Keep Vega dependencies isolated in a Vega target so regular iOS, Android, Fire OS, and Horizon builds do not install Amazon Kepler packages.
The Android store resolver (openiapStore, flavors, connected devices) picks the Fire OS Android flavor only — it is not a Vega selector and has no effect on Vega builds.
Check the Vega SDK release notes for the current supported React Native for Vega version before choosing Kepler package versions.
Expo#
Expo recognizes a Vega target on its own: a root manifest.toml turns Vega file generation on, so a fresh checkout with a committed manifest needs no flag. Generation also writes a root index.js, so when the same root builds Android, keep a main in package.json; without one, that file becomes the Android entry. modules.amazon.fireOS turns detection off. Set modules.amazon.vegaOS explicitly only to force generation on for a first run or off for every build. The Fire OS build is a separate artifact that the Android build picks like any other store.
plugins: [
[
'expo-iap',
{
modules: {
amazon: {
vegaOS: true,
},
},
},
],
]Vega metadata is automatic by default. packageId defaults from the Android package or iOS bundle id, title defaults from the Expo app name, appName defaults from the title, and icon defaults from the Expo icon. Only set optional android.amazon.vegaOS overrides when the Vega package metadata needs to differ from the normal Expo app metadata.
React Native#
Bare React Native uses a separate React Native for Vega project. The target owns the Amazon dependencies, Kepler metadata, and manifest.toml.
# In the Vega-only React Native target
yarn add react-native-iap
yarn add @amazon-devices/keplerscript-appstore-iap-lib@~2.13.0 @amazon-devices/react-native-kepler@^2.0.0
yarn add -D @amazon-devices/kepler-cli-platform@~0.22.0 @react-native-community/cli@<vega-cli-compatible-version> @react-native/metro-config@<matching-react-native-version>schema-version = 1
[package]
id = "dev.your.app"
title = "Your App"
version = "1.0.0"
[components]
[[components.interactive]]
id = "dev.your.app.main"
runtime-module = "/com.amazon.kepler.keplerscript.runtime.loader_2@IKeplerScript_2_0"
launch-type = "singleton"
categories = ["com.amazon.category.main"]
[needs]
[[needs.module]]
id = "/com.amazon.kepler.appstore.iap.purchase.core@IAppstoreIAPPurchaseCoreService"
[[needs.module]]
id = "/com.amazon.vega.os@IVega_1_2"
[os.version]
target = "1.2"
min = "1.2"Verification#
Receipt verification is a server-side responsibility for both Fire OS and Vega OS. If you use IAPKit as that implementation, follow its Amazon verification guide. Other backends should validate the Amazon user and receipt evidence with Amazon RVS before granting access.
See Validation for the cross-store verification model.