Reports the Vendure Platform capability keys that the current license grants. The Dashboard shows a locked item for each promoted Platform capability that is not in this set. The License Guard Dashboard extension calls this function. Each call replaces the earlier set.
The Dashboard applies these rules:
LicenseGuardPlugin: the granted set is empty, and the
Dashboard shows all locked items on the first render.LicenseGuardPlugin and this function was called: the
Dashboard uses the reported set.LicenseGuardPlugin and this function was not called
(yet): the Dashboard shows no locked items.Call it before the first render if you can, for example at the top level of the
extension entry file, or from a customProviders component that loads the grants.
Example
Parameters
readonly string[]The data that the Dashboard needs to show locked Vendure Platform items. It is returned by usePlatformPromotion.
DashboardPromotionV1The Platform catalog data, read at build time. If the build could not fetch it,
this is the snapshot that ships with @vendure/common.
ReadonlyMap<string, DashboardPromotionCapabilityV1>promotion.capabilities, keyed by capability key.
booleantrue when the Vendure config contains the LicenseGuardPlugin.
ReadonlySet<string>The capability keys that the license grants. Empty when License Guard is not configured.
booleantrue when the Dashboard must show no locked items: Platform promotion is turned off
in the build, or License Guard is configured but it did not report a granted set.
(capability: string) => booleanReturns true when the Dashboard shows the locked item for the capability:
hideAll is false and the capability is not granted.
Returns the current PlatformPromotionState outside of React. Use usePlatformPromotion in components.
Returns the PlatformPromotionState. The component renders again when setPlatformGrantedCapabilities reports a new granted set.
Example
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team