Amazon Publisher Services
Amazon Publisher Services (APS) allows publishers to use a Client-to-Server (C2S) call that returns bid information to be passed to your publisher ad server. The client application, deployed on Amazon Fire TV or Fire Tablet devices, constructs an APSBidRequest and sends it to the APS service. This integration is available on Android only.
Overview
APS enables publishers to:
- Request programmatic bids from Amazon's ad system
- Pass bid responses to your ad server or SSAI provider
- Optimize ad delivery on Fire TV and Fire Tablet devices
- Support both VOD and Live content streams
Prerequisites
- Amazon Fire TV or Fire Tablet device (Android)
- APS service access credentials
- Familiarity with your ad server or SSAI provider integration
Basic Setup
Step 1: Create the APS Bid Request
Import the required APS types and construct your bid request:
import {
APSVideoImpression,
APSDeviceInfo,
APSContent,
APSApplication,
APSBidRequest,
bidService,
} from '@quickplay/rn-qp-nxg-player';
// Define video impressions (ad slots)
const videoImpressions: APSVideoImpression[] = [
{
width: 540,
height: 960,
slotID: '<slot-id-1>',
},
{
width: 540,
height: 960,
slotID: '<slot-id-2>',
},
];
// Define device information
const deviceInfo: APSDeviceInfo = {
userAgent: '<your-app-user-agent>',
privacyRule: 'TRACKING_UNRESTRICTED',
advertisingID: '<device-advertising-id>',
language: 'en',
};
// Define content metadata
const contentInfo: APSContent = {
id: '<content-id>',
rating: 'TV-G',
genre: 'Adventure',
channel: '<channel-name>',
length: '<duration-in-seconds>',
language: 'en',
};
// Define application information
const applicationInfo: APSApplication = {
id: '<app-id>',
name: '<app-name>',
domain: '<app-domain>',
bundle: '<bundle-id>',
storeURL: '<store-url>',
content: contentInfo,
inventoryPartnerDomain: '<ipd-domain>',
};
// Construct the APS bid request
const request: APSBidRequest = {
id: '<unique-request-id>',
application: applicationInfo,
device: deviceInfo,
videoImpressions: videoImpressions,
privacyToken: '<privacy-token>',
};
Step 2: Request Bids from APS
Call getAmazonPublisherServicesBids to retrieve bid responses:
const apsUrl = 'https://aax-ott-c2s.amazon-adsystem.com/e/c2s/ads';
const response = await bidService.getAmazonPublisherServicesBids(apsUrl, request);
The response is a key-value pair containing bid information to be passed to your ad server or SSAI provider.
VOD Integration
For Video on Demand content, pass the APS bid response as adTagParameters in the player configuration:
const playerConfig: PlayerConfig = {
mediaURL: '<content-url>',
contentType: 'VOD',
mediaType: 'HLS',
// ... other config
adTagParameters: response, // Pass APS bid response
};
const player = await createPlayer(playerConfig);
await player.play();
Live Integration
For live streams, update the ad tag dynamically using the replaceAdTag API. Call this at each ad break start:
// Create player
const playerConfig: PlayerConfig = {
mediaURL: '<live-stream-url>',
contentType: 'LIVE',
mediaType: 'HLS',
// ... other config
};
const player = await createPlayer(playerConfig);
// Replace ad tags at each ad break
const apsUrl = 'https://aax-ott-c2s.amazon-adsystem.com/e/c2s/ads';
const response = await bidService.getAmazonPublisherServicesBids(apsUrl, request);
await player.replaceAdTag(response);
Important Notes
Always call getAmazonPublisherServicesBids() on every playback start for VOD content and at every ad break start for live streams. Do not reuse previous bid responses, as they may have expired or become invalid.
APS Request Parameters Reference
APSDeviceInfo
| Property | Type | Required | Description |
|---|---|---|---|
userAgent | string | Yes | Application's user-agent string |
privacyRule | string | Yes | Privacy setting: 'TRACKING_UNRESTRICTED' (most common) |
advertisingID | string | Yes | Device advertising identifier |
language | string | Yes | Device language code (e.g., 'en') |
APSContent
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique content identifier |
rating | string | No | Content rating (e.g., 'TV-G', 'PG-13') |
genre | string | No | Content genre |
channel | string | No | Channel or category name |
length | string | No | Content duration in seconds |
language | string | No | Content language code |
APSApplication
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique application identifier |
name | string | Yes | Application name |
domain | string | Yes | Application domain |
bundle | string | Yes | Application bundle ID |
storeURL | string | Yes | Link to app store listing |
content | APSContent | No | Content metadata object |
inventoryPartnerDomain | string | No | Inventory partner domain |
APSVideoImpression
| Property | Type | Required | Description |
|---|---|---|---|
width | number | Yes | Ad slot width in pixels |
height | number | Yes | Ad slot height in pixels |
slotID | string | Yes | Unique ad slot identifier |
APSBidRequest
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique bid request ID (recommend: UUID + timestamp) |
application | APSApplication | Yes | Application information |
device | APSDeviceInfo | Yes | Device information |
videoImpressions | APSVideoImpression[] | Yes | Array of ad slot definitions |
privacyToken | string | No | Privacy consent token |