npm i @pelicanplatform/web-client
import Client from "@pelicanplatform/web-client";
const discoveryUrl = "https://osg-htc.org" // Example discovery URL used for OSDF
const filePath = "/example/file/path.txt" // Example file path
const webClient = new Client(discoveryUrl);
try {
webClient.getFile(filePath) // Downloads file to path.txt
} catch (e) {
pass
}
Example usage can be found here:
https://github.com/PelicanPlatform/web-client/blob/main/website/src/app/page.tsx