Skip to content

PelicanPlatform/web-client

Repository files navigation

Pelican Web Client

Dynamic JSON Badge Dynamic JSON Badge

NPM Github

Installation

npm i @pelicanplatform/web-client

Usage

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