Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StorefrontAPI

Interface that contains functions for integrating with Storefront.

Hierarchy

  • StorefrontAPI

Index

Methods

deregister

  • deregister(id: string): Promise<void>
  • Deregister a provider.

    import { Storefront, StorefrontProvider } from "@openfin/workspace";

    //Instantiate a StorefrontProvider
    const myStorefrontProvider: StorefrontProvider = {
    id: "my-storefront-id"
    title: "My StoreFrontProvider"
    icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
    getApps: () => {...},
    getNavigation: () => {...},
    getLandingPage: () => {...},
    getFooter: () => {...},
    launchApp: () => {...}
    };

    const register = async () => {
    await Storefront.register(myStorefrontProvider);
    }

    //Do work with myStorefrontProvider

    const deregister = async () => {
    await Storefront.deregister("my-storefront-id");
    }

    Parameters

    • id: string

      the id of the provider.

    Returns Promise<void>

hide

  • hide(): Promise<void>
  • Hides the Storefront window. Awaits for the latest [[Storefront.register()]] internally, so you don't have to. Throws an error if a StorefrontProvider doesn't exist (i.e., because register() was not called previously).

    import { Storefront } from "@openfin/workspace";

    const hide = async () => {
    await Storefront.hidef();
    //Do thing after show
    }

    Returns Promise<void>

register

  • Registers a StorefrontProvider. Upon registering a provider, the title of your provider appears in the menu of the Storefront UI. When a user selects your Storefront, the methods on the provider object are called to populate the UI. Throws an error if a provider with the same id already exists.

    import { Storefront, StorefrontProvider } from "@openfin/workspace";

    //Declare a provider
    const myStorefrontProvider: StorefrontProvider = {
    id: "my-storefront-id"
    title: "My StorefrontProvider"
    icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
    getApps: () => {...},
    getNavigation: () => {...},
    getLandingPage: () => {...},
    getFooter: () => {...},
    launchApp: () => {...}
    };

    const registerProvider = async () => {
    await Storefront.register(myStorefrontProvider);
    }

    Parameters

    Returns Promise<void>

show

  • show(): Promise<void>
  • Shows the Storefront window. Awaits for the latest [[Storefront.register()]] internally, so you don't have to. Throws an error if a StorefrontProvider doesn't exist (i.e., because register() not called previously).

    import { Storefront } from "@openfin/workspace";

    const show = async () => {
    await Storefront.show();
    //Do thing after show
    }

    Returns Promise<void>

Generated using TypeDoc