resolveScheme

Resolves the scheme of a given URI and returns the corresponding URL. If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. If the URI starts with "http", it returns the URI as is. Otherwise, it throws an error indicating an invalid URI scheme.

Example

import { resolveScheme } from "thirdweb/storage";
const url = resolveScheme({
client,
uri: "ipfs://Qm...",
});

Parameters

Returns

The resolved URL.