Skip to main content

ThirdwebStorage.downloadJSON() method

Downloads JSON data from any URL scheme. Resolves any URLs with schemes to retrievable gateway URLs.

Signature:

downloadJSON<TJSON = any>(url: string): Promise<TJSON>;

Parameters

ParameterTypeDescription
urlstringThe URL of the JSON data to download

Returns:

Promise<TJSON>

The JSON data fetched from the resolved URL

Example

const uri = "ipfs://example";
const json = await storage.downloadJSON(uri);