APSClientLibrary is a library that provides a single API for Amazon Publisher apps to retrieve device parameters. You can compile your bid request and send it to APS through a client-to-server (C2S) or server-to-server (S2S) integration.
This document explains the APSClientLibrary installation and API usage.
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 you use the APS device side APIs.Get started with APSClientLibrary
Use APS client library"@amazon-devices/kepler-aps-client": "~1.0.8" for react native API integration.
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.-
components.interactivemust includeruntime-module = "/com.amazon.kepler.keplerscript.runtime.loader_2@IKeplerScript_2_0". -
wants.modulemust includeid = "/com.amazon.kepler.apslib@IApsDeviceParametersMap".
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.Step 5. Complete the payload
Complete the JSON payload creation for a HeaderBidding request and makes an HTTPS request following the remaining cloud interactions using the C2S or S2S integration guides.Required parameters
Installation and setup
Build your app
This example uses an app named mykeplerapp. Step 1. Install app dependencies.Install your package
Install your package and run it.Install the app and launch it
APS Streaming TV integration
Amazon Publisher Services offers publishers two distinct integration paths for the Vega TV platform. These integrations allow publishers to submit bid requests to fill their ad break inventory.The C2S integration
Publishers use a C2S call that returns the bid information to the publisher ad server as custom key values. You can only call our server from your app, since we don’t support server-side calls with this integration.- API Protocol: HTTPS
- Endpoint:
- Recommended Timeout: 1000 ms
The S2S integration
Publishers retrieve APS key value pairs using an S2S back-end call that returns the bid information to the publisher ad server. You can call our server only from your server, since we don’t support client-side calls.- API Protocol: HTTPS
- Endpoint: .
- Recommended Timeout: 500 ms.

