AboutSupportDeveloper GuideVersion 19.0.5

Interface StoreRegistration

Response from store registration which includes metadata and a function to update app cards buttons.

Hierarchy

Properties

clientAPIVersion: string

Client API version

This is the version of the Workspace client API that is being used to register the component.

updateAppCardButtons: ((request) => Promise<void>)

Type declaration

    • (request): Promise<void>
    • Function to updates app card button config.

      Parameters

      • request: UpdateButtonConfigRequest

        object that contains primary button and secondary buttons configs that will be used to update button configuration returned by provider for an app.

      Returns Promise<void>

      Example

      Updating primary button title and disabled flag.
      

      Example

      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();
workspaceVersion: string

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.