AboutSupportDeveloper GuideVersion 16.0.4
  • API function to register a Home provider.

    Parameters

    Returns Promise<HomeRegistration>

    A promise that resolves with a HomeRegistration object once the Dock provider is successfully registered. This contains the client API version, Workspace Version and a function to set the search query.

    Remarks

    A Workspace Platform must be initialized.

    Throws

    An error if the Workspace Platform is not initialized.

    Throws

    An error if a Home provider with the same id is already registered.

    Example

    Register a Basic Home provider

    import { Home, type HomeProvider } from '@openfin/workspace';

    const provider: HomeProvider = {
    title: "My Home Provider"
    inputPlaceholder: "Search with My Home Provider",
    icon: "https://www.openfin.co/favicon-32x32.png",
    listTitle: "My Home Provider Results",
    logoUrl: "https://www.openfin.co/favicon-32x32.png",
    id: "my-home-provider",
    onUserInput: (req, res) => {
    console.log(req.query);
    return { results: [], context: { filters: [] } }
    },
    dispatchFocusEvents: true,
    };

    await Home.register(provider)

    await Home.show()