🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

firebase-storage-kit

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-storage-kit

Storage manager for Firebase Storage with uploads, progress tracking, batch uploads, and file query helpers.

Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
22
10%
Maintainers
1
Weekly downloads
 
Created
Source

firebase-storage-kit

Storage manager for Firebase Storage with uploads, progress tracking, batch uploads, and file query helpers.

Install

With npm:

npm install firebase-storage-kit

Or with Yarn, pnpm, or Bun:

yarn add firebase-storage-kit
pnpm add firebase-storage-kit
bun add firebase-storage-kit

Quick start

import { getStorage } from "firebase/storage";
import { StorageManager } from "firebase-storage-kit";

const storage = getStorage(app);
const manager = new StorageManager(storage);

const handle = manager.uploadFile(file, { path: `uploads/${file.name}` });

handle.on("progress", (upload) => {
  console.log(upload.progress);
});

handle.on("success", (upload) => {
  console.log(upload.downloadURL);
});

Batch uploads

const batch = manager.uploadFiles(
  files,
  (file) => ({ path: `uploads/${file.name}` }),
  { concurrency: 3, continueOnError: true },
);

batch.on("success", (snapshot) => {
  console.log(snapshot.completedCount, snapshot.failedCount);
});

Subscriptions (manager state)

const unsubscribe = manager.subscribe((state) => {
  console.log(state.uploads, state.batches);
});

Upload retries

Uploads retry transient failures automatically (3 retries by default, exponential backoff with jitter). Pass retry: false to disable, or customize:

const handle = manager.uploadFile(file, {
  path: `uploads/${file.name}`,
  retry: { maxRetries: 5, initialDelayMs: 700 },
});

handle.on("retry", ({ attempt, maxAttempts, delayMs, error }) => {
  console.log(`Retry ${attempt}/${maxAttempts} in ${delayMs}ms`, error.message);
});

Querying files

const exists = await manager.exists("uploads/photo.jpg");

if (exists) {
  const meta = await manager.getMetadata("uploads/photo.jpg");
  const url = await manager.getDownloadURL("uploads/photo.jpg");
  console.log(meta.size, url);
}

await manager.delete("uploads/old.jpg");

exists returns false only when the object is not found. Permission and network errors are thrown.

License

MIT

Keywords

firebase

FAQs

Package last updated on 26 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts