Skip to main content

Platform Extensions

Geo Location

The Quickplay Platform determines user's geo-location based on incoming client IP. To access the platform determined geo location info, use the following extension API

try {
const locationData = await flPlatformAuthorizer.PlatformExtensions.getGeoLocation(
'https://<host>',
authorizer,
);
console.log('location ', locationData);
} catch (e) {
console.error(e);
}

Adobe Primetime - FLAT Token

To generate a Quickplay Access Token (FLAT) for TVE flows via Adobe Primetime, use the below extension API by passing the following info:

NameTypeRequiredDescription
deviceIdStringRequiredUnique device identifier. Refer to Secure Playback for generating a unique device id.
deviceInfoStringRequiredBase64 encoded Device Info. Refer Adobe Primetime docs for the device info spec.
try {
const flatToken = await flPlatformAuthorizer.PlatformExtensions.getAdobePrimeTimeToken(
'https://<host>',
deviceId,
deviceInfo,
authorizer,
);
console.log('token ', flatToken);
} catch (e) {
console.error(e);
}

Alternatively, to generate a Quickplay Access Token (FLAT) the below extension API can be used by passing the following info:

NameTypeRequiredDescription
deviceIdStringRequiredUnique device identifier. Refer to Secure Playback for generating a unique device id.
deviceInfoStringRequiredBase64 encoded Device Info. Refer Adobe Primetime docs for the device info spec.
userIdStringRequiredAdobe user identifier.
profileIdStringOptionalUnique identifier of the user profile. This is applicable only for multi-profile user accounts.
try {
const primeTokenResult = await flPlatformAuthorizer.PlatformExtensions.getAdobePrimetimeTokenV2(
'https://<host>',
deviceId,
deviceInfo,
userId,
authorizer,
profileId
);

console.log('token ', primeTokenResult.token);
console.log('expires in ', primeTokenResult.expiresIn);
} catch (e) {
console.error(e);
}

Generic Platform API

All Quickplay Platform APIs are zero-trust protected and require OAuth token. The Platform Core client library manages the OAuth token and abstracts the ability to securely communicate with the Quickplay Platform. While many of the Platform APIs are exposed as direct APIs, some tenent specific APIs might not be available as direct API on the client library. In such cases, application could use the authorizeRequest API to communicate with the specific Platform API.

Create Request

const httpClient = flFoundation.createHttpClient();

const request = flFoundation
.createRequestBuilder()
.url('https://<host>/device/location/lookup')
.build();

Initiate Request

Initiate an authorized request using the makeAuthorizedRequest APIs on the HTTPClient instance. This API allows initiating all standard HTTP requests and automatically injects the required Authentication headers to securely communicate with the Quickplay Platform.

try {
const locationData = await flPlatformAuthorizer.makeAuthorizedHttpCall(
httpClient,
authorizer,
request,
);
console.log('location ', locationData);
} catch (e) {
console.error(e);
}
note

Refer the Secure Playback section for creating platform authorizer instance.