Client API version
This is the version of the Workspace client API that is being used to register the component.
Function to updates app card button config.
object that contains primary button and secondary buttons configs that will be used to update button configuration returned by provider for an app.
Updating primary button title and disabled flag.
Updating primary button title and disabled flag.
let storeRegistration: StoreRegistration | undefined;
await WorkspacePlatform.init({
customActions: {
storeButtonCustomActionHandler: async (payload: StoreCustomButtonActionPayload) => {
if (storeRegistration) {
await storeRegistration.updateAppCardButtons({
appId: payload.appId,
primaryButton: {
...payload.primaryButton,
title: 'Disabled Button',
disabled: true,
},
secondaryButtons: payload.secondaryButtons
});
}
}
}
});
const sampleApp: App = {
title: 'Sample Application',
addId: 'sampleAppId',
icons: [],
publisher: 'Sample',
primaryButton: {
title: 'Sample Button',
action: {
id: 'storeButtonCustomActionHandler',
}
}
},
const storefrontProvider: StorefrontProvider = {
title: 'Sample Store',
id: 'sampleStoreId',
icon: {...},
getApps: () => Promise.resolve([sampleApp]),
getLandingPage: {...},
getNavigation: {...},
getFooter: {...},
launchApp: (app: App) => WR.getCurrentSync().launchApp({app})
};
storeRegistration = await Store.register(storefrontProvider);
await Store.show();
Workspace version
This is the version of Workspace that the Workspace component is running on. This could be used to determine if the component is running on a version of Workspace that supports a particular feature.
Response from store registration which includes metadata and a function to update app cards buttons.