Skip to Content
The new glomex player is released! 🎉View upgrade guide

Interface: SharedContextData

The data object accepted by SharedContext.set.

Every field is optional and merged on top of previously set values. Calling set() multiple times merges incrementally — previously set values are preserved unless explicitly overwritten.

Properties

appBundleId?

optional appBundleId: string

The bundle id of the app. Only required for iOS apps.


appName?

optional appName: string

The name of the app. When it is a website, fill in the name of the project.


appStoreId?

optional appStoreId: string

The store id of the app. Only required for apps. Depending on the app store, the id is formatted differently.

IAB Tech Lab App Identification Guidelines 


appStoreUrl?

optional appStoreUrl: string

The store URL of the app. Only required for apps.

IAB Tech Lab App Identification Guidelines 


appVersion?

optional appVersion: string

The version of the app. When it is a website, fill in the deployed version of the website.


b2bContext?

optional b2bContext: string

Business-to-business context identifier.


deviceId?

optional deviceId: object

Device id of the user. Only required for app environments. When no listed deviceId is available, you can pass a ppid as a user id instead.

id

id: string

name

name: DeviceIdName | "aaid" | "afai" | "asia" | "asid" | "tifa" | "vaid" | "idfa" | "idfv" | "lgudid" | "msai" | "oaid" | "psnai" | "rida" | "vida" | "waid"


presentationalContext?

optional presentationalContext: "curated-list" | "discovery-page"

The presentational context of the integration. Do not define it when it is not part of those contexts.


providers?

optional providers: object

Media-provider-specific context resolvers keyed by provider name.

Each resolver is called every time the player needs fresh context for the given provider (e.g. to obtain a fresh auth token).

Index Signature

[providerName: string]: (context?) => MediaProviderContext | Promise<MediaProviderContext>

Example

sharedContext.set({ providers: { 'my-provider': async () => ({ token: await myAuth.getFreshToken(), }), }, });

userIds?

optional userIds: object[] | () => Promise<object[]> | object[]

Identifiers for the current user (e.g. netID, LiveRamp, PAIR).

You can pass either a static array or a resolver function. A resolver is re-invoked every time the player needs user IDs (for example before each ad request), so it can return a different set of IDs when the user’s consent state has changed. The resolver may be asynchronous.

Examples

sharedContext.set({ userIds: [{ id: '...', name: 'netId' }], });
sharedContext.set({ userIds: async () => await cmp.getConsentedUserIds(), });
Last updated on