download

Example

Download a file from IPFS:

import { download } from "thirdweb/storage";
import { createThirdwebClient } from "@thirdweb-dev/sdk";
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
const file = await download({
client,
uri: "ipfs://Qm...",
});

Download a file from Arweave:

import { download } from "thirdweb/storage";
import { createThirdwebClient } from "@thirdweb-dev/sdk";
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
const file = await download({
client,
uri: "ar://{arweave-transaction-id}",
});

Download a file from HTTP:

import { download } from "thirdweb/storage";
import { createThirdwebClient } from "@thirdweb-dev/sdk";
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
const file = await download({
client,
uri: "https://example.com/file.txt",
});

Parameters

Returns

Asynchronously returns the network response from fetching the file.