diff --git a/desktop/flipper-server-core/src/plugins/fb-stubs/pluginMarketplaceAPI.tsx b/desktop/flipper-server-core/src/plugins/fb-stubs/pluginMarketplaceAPI.tsx new file mode 100644 index 000000000..12934bb05 --- /dev/null +++ b/desktop/flipper-server-core/src/plugins/fb-stubs/pluginMarketplaceAPI.tsx @@ -0,0 +1,24 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {FlipperServer, MarketplacePluginDetails} from 'flipper-common'; + +export async function loadAvailablePlugins( + server: FlipperServer, + marketplaceURL: string, +): Promise { + try { + const response = await fetch(marketplaceURL); + const plugins = await response.json(); + return plugins; + } catch (e) { + console.error('Failed while retrieving marketplace plugins', e); + return []; + } +}