Uploads a file to IPFS via Pinata and returns the CID
The file to upload to IPFS
Optional
filename: stringOptional custom filename
Promise that resolves to the IPFS CID (content identifier)
Download a file from the storage provider
Promise with file blob
Lists files uploaded to Pinata with optional filtering
Optional
options: StorageListOptionsOptional query parameters for filtering and pagination
Maximum number of results to return (default: 10)
Number of results to skip for pagination
Filter files by name pattern
Promise that resolves to an array of PinataFile objects
This method retrieves a list of files that have been uploaded to Pinata, filtered to only include files uploaded by the Vana SDK. You can further filter results by name pattern, limit results, or paginate through them.
// List all files
const allFiles = await pinataStorage.list();
// List with pagination and filtering
const filteredFiles = await pinataStorage.list({
limit: 20,
offset: 10,
namePattern: "document"
});
filteredFiles.forEach(file => {
console.log(`${file.name} (${file.size} bytes): ${file.cid}`);
});
Deletes a file from Pinata by unpinning it from IPFS
The IPFS URL or content identifier of the file to delete
Promise that resolves when the file is successfully unpinned
This method removes the file from your Pinata account by unpinning it, which means it will no longer be guaranteed to be available on the IPFS network. Note that if the file is pinned elsewhere or cached by other nodes, it may still be accessible for some time.
// Delete a file by CID
await pinataStorage.delete("QmTzQ1JRkWErjk39mryYw2WVrgBMe2B36gRq8GCL8qCACj");
console.log("File unpinned from Pinata");
// Delete after listing
const files = await pinataStorage.list();
for (const file of files) {
if (file.name.includes("temp")) {
await pinataStorage.delete(file.cid);
}
}
Get provider-specific configuration
Provider configuration object
Provides managed IPFS storage with full-featured API via Pinata
Remarks
This provider uses Pinata's enhanced IPFS service, which extends standard IPFS with additional features like file listing, deletion (unpinning), and rich metadata. It's the "it just works" solution for developers who want full CRUD operations on IPFS without managing infrastructure.
Example