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
The Vega APS Client API is a bridge between React Native for Vega apps and the native code implementation for the Amazon Publisher Services(APS). The API provides the getDeviceParams() method to fetch the required parameters for your bid request. You send these parameters to APS via C2S (Client-to-Server) or S2S (Server-to-Server) integration to complete the request. This user guide explains APS client library installation and API usage. For an introduction to Amazon Publisher Services, see Amazon Publisher Services.

Prerequisites

Before you begin, make sure you have installed the Vega SDK and created your own JavaScript app. You must also have followed either the C2S or S2S integration guide to complete the cloud side onboarding, and you should understand how payload creation works. Here’s how to use the APS device side APIs.

Get started with APSClientLibrary

Step 1. Include the package dependencies in your app

Add the library as a dependency in your package’s package.json file.

Step 2. Update your manifest file

Update your manifest.toml file to include the required dependencies.
  1. components.interactive must include the appropriate runtime-module for your React Native version.
  2. wants.module must include id = "/com.amazon.kepler.apslib@IApsDeviceParametersMap".
The following is an example for a sample app. manifest.toml

Step 3. Import the API into your app

Import the required device parameters for your JavaScript app.
ApsClientLibraryAPI.getDeviceParams is asynchronous and returns a Promise which can be used with an await or then() construct. On success, the payload of the Promise is a mapping of a ApsDeviceParametersMap, which contains keys from Required Parameters) to their respective values. If an error occurs, the promise is rejected with an error message. The recommended way to use the function is to call it when the app loads and cache the returned value. The following code example demonstrates handling both success and error cases using the then() construct. This example assumes a server-to-server (S2S) integration passing ApsIntegrationType.c2s instead of a client-to-server (C2S) integration. The following code sample demonstrates handling both success and error cases, using the then() construct:

Step 4. Check the required parameters

Besides device parameters, capture the IP from the HTTP request sent to the server and include it as part of the request payload. Refer to the Required Parameters table for more information.

Required parameters

ParameterDescriptionIntegrationType: S2SIntegrationType: C2SProvided by This API
hPhysical height of the screen in pixels.YYY
wPhysical width of the screen in pixels.YYY
dntStandard “Do Not Track” flag as set in the header by the browser, where 0 = tracking is unrestricted, and 1 = Do Not Track.YYY
ifaThe Advertising ID for your Device.YYY
uaDevice user agent (a string).YYY
makeDevice manufacturer (for example, Amazon).YYY
languageDevice language using ISO-639-1-alpha-2.YYY
modelDevice model (for example, AFTT).YYY
osDevice operating system (for example, Android).YNY
osvDevice operating system version (for example, 5.1.1).YNY
ipIPv4 address closest to device (public IP) (for example, 204.78.58.34).YNN (Note for S2S only: Capture the IP from the HTTPS request sent to the server).

Step 5. Complete the payload

Complete the JSON payload creation for a HeaderBidding request and make an HTTPS request following the remaining cloud interactions using the C2S or S2S integration guides.

Build and install your app

Build your app

This example uses an app named mykeplerapp. Step 1. Install app dependencies.
Step 2. Generate the .vpkg file.

Install your package

Install your package and run it.

Install the app and launch it

API Reference

Classes

Interfaces

Enumerations

Type Aliases

Functions

Variables


Last modified on July 22, 2026