Prerequisites
The following list shows the items you need before you can add LWA to your Vega app:- Vega SDK installed on your computer.
- Amazon Developer Account.
- An existing Vega app. You can download the Vega Video Sample App to use as a template for your app.
- Your app must be registered with Login with Amazon. For more information, see Register for Login with Amazon.
- An API key for your app. For more information, see Get an API key
- Vega-supported Fire TV Stick. LWA does not support the Vega Virtual Device so you need to test your integration on a device.
Get an API key
To use LWA with your app, you need to provide the app’s API key. The API key is an identifier that the Amazon Authorization Manager uses to identify your app to the LWA authorization service. You need different API Keys for debug and production apps. You generate the API key using the app package ID and the app MD5 and SHA256 Signatures. While the package ID for the debug and production versions of your app is the same, you use different procedures to retrieve the MD5 and SHA256 Signatures. To retrieve the signature for a debug app, see MD5 and SHA256 Signatures for debug apps. For production apps, see MD5 and SHA256 Signatures for production apps. Follow the steps below to create an API ey and add it to your LWA account:- Open the Amazon Appstore Developer Console and log in to your account.
- Create or open an existing security profile. For more information, see LWA docs.
-
Add an API key for your Vega app.
- Select Android/Kindle Settings.
-
Go to Add an API Key. Enter the following information:
- API Key Name - create a name to identify your app.
- Package - enter your package ID, such as
com.mycompany.myapp. - MD5 Signature - enter the MD5 signature.
- SHA256 Signature - enter the SHA256 signature.
MD5 and SHA256 Signatures for debug apps
- Connect the Fire TV Stick to your development machine.
-
Open a terminal shell and run the vda
devicescommand. - Confirm the device serial number is listed in the output. .
-
Open a terminal shell and run the vda
- In the terminal, run . Replace with your app’s package name. You can find the package name in your manifest.toml file.
- Locate the signature information.
- In the command output, find the “Signers info” section.
- Note down both the MD5 and SHA256 signatures for any one of the signers. For the SHA256 signature, there are two lines in the output. Connect the lines with a
:. For example, if your output shows this for SHA256:
17:6c:1b:d5:24:d6:0d:6c:e7:88:fd:9c:61:09:c2:01:b2:21:2a:79:66:10:c8:a7:74:64:11:d0:13:39:31
MD5 and SHA256 Signatures for production apps
For a release, or “production”, version of your app, you must create an additional API key using Appstore’s MD5 and SHA256 signatures and store it in your app’s manifest.toml file. This is also required for apps that use In-App Purchasing (IAP) or Live App Testing (LAT). You can find your Appstore certificate hash values in the Developer Console to create the API keys for existing apps. Go to My apps > select your app’s current version > Upload Your App File > Appstore Certificate Hashes.Extract clientID from API key
The API key is a JWT (JSON Web Token). You can decode this key to find yourclientID, which is used for backend services.
Use any JWT decoding tool to decode the API key.
Setup
-
Add the following library dependency to the
dependenciessection of your package.json file. -
In your manifest.toml, add the following privilege and replace
api_keywith the API key that you obtained earlier.
Usage
Example: Authorize a user
The following code example demonstrates how to integrate theAuthorize call into your React Native components to initiate user authorization flow and obtain access tokens and user details.
Example: Get an authorization token
The following code example demonstrates how to integrate theGetToken call into your React Native components to retrieve authorization tokens for specified scopes.
Example: Get user details
The following code example demonstrates how to integrate theGetUser call into your React Native components to fetch and display user profile information.
Example: Sign out a user
The following code example demonstrates how to integrate theSignout call into your React Native components to allow users to securely sign out from their accounts.
Modules
- index
- turbo-modules/KeplerLWATurboModuleManager
- turbo-modules/KeplerLWATurboModuleManager
- turbo-modules/keplerLWATurboModules
- turbo-modules/keplerLWATurboModules
- types/LWADataTypes
- types/LWADataTypes

