Skip to main content

useStorage

Get the instance of the ThirdwebStorage class being used by the ThirdwebProvider.

Allows you to use the TypeScript SDK functionality of Storage in your React app.

Configurable in the storageInterface prop of the ThirdwebProvider.

import { useStorage } from "@thirdweb/react";

Usage

import { useStorage } from "@thirdweb-dev/react";

export default function Component() {
const storage = useStorage();

// Now you can use the functionality of the ThirdwebStorage class:
storage?.download(); // Download a file from IPFS
storage?.upload(); // Upload a file to IPFS
}