game-common / pragma.inventory / EntitlementProviderPlugin /

EntitlementProviderPlugin #

interface EntitlementProviderPlugin : PragmaServicePlugin

Plugin interface used to manage entitlement fulfillment with a third party provider.

Functions #



abstract fun entitlementProviderId(): String

A unique ID for the provider this plugin is implemented for. Used when mapping entitlements returned from fetchPlayerEntitlements to content configured in ThirdPartyEntitlementMappings.json


abstract suspend fun fetchPlayerEntitlements(playerId: PlayerId, idProviderAccounts: List<AccountRpc.IdProviderAccount>): List<Entitlement>

Used by the Inventory Service to obtain a full view of the player’s entitlements in the third party provider. These results will be used to determine if any Pragma content should be granted or removed from the player’s inventory.


open fun List<AccountRpc.IdProviderAccount>.getByProvider(idProvider: AccountRpc.IdProvider): AccountRpc.IdProviderAccount?

Retrieves the associated IdProviderAccount for a given IdProvider, ex: "STEAM", "TWITCH", etc. or null if no such account can be found.


abstract suspend fun markEntitlementsConsumed(playerId: PlayerId, idProviderAccounts: List<AccountRpc.IdProviderAccount>, entitlements: List<Entitlement>)

This method will be invoked with the list consumable entitlements previously returned by fetchPlayerEntitlements that had been successfully marked for fulfillment internally in Pragma.