firebase-storage-kit 1.2.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,21 +2,15 @@
2
2
 
3
3
  Storage manager for Firebase Storage with uploads, progress tracking, batch uploads, and file query helpers.
4
4
 
5
- ## Install
5
+ **Full documentation:** [firebase-storage-kit.vercel.app/docs](https://firebase-storage-kit.vercel.app/docs)
6
6
 
7
- With npm:
7
+ ## Install
8
8
 
9
9
  ```bash
10
- npm install firebase-storage-kit
10
+ npm install firebase firebase-storage-kit
11
11
  ```
12
12
 
13
- Or with Yarn, pnpm, or Bun:
14
-
15
- ```bash
16
- yarn add firebase-storage-kit
17
- pnpm add firebase-storage-kit
18
- bun add firebase-storage-kit
19
- ```
13
+ Also works with Yarn, pnpm, or Bun. See [Installation](https://firebase-storage-kit.vercel.app/docs/getting-started/installation) for all package managers.
20
14
 
21
15
  ## Quick start
22
16
 
@@ -38,58 +32,24 @@ handle.on("success", (upload) => {
38
32
  });
39
33
  ```
40
34
 
41
- ### Batch uploads
42
-
43
- ```ts
44
- const batch = manager.uploadFiles(
45
- files,
46
- (file) => ({ path: `uploads/${file.name}` }),
47
- { concurrency: 3, continueOnError: true },
48
- );
49
-
50
- batch.on("success", (snapshot) => {
51
- console.log(snapshot.completedCount, snapshot.failedCount);
52
- });
53
- ```
54
-
55
- ### Subscriptions (manager state)
56
-
57
- ```ts
58
- const unsubscribe = manager.subscribe((state) => {
59
- console.log(state.uploads, state.batches);
60
- });
61
- ```
62
-
63
- ### Upload retries
35
+ ### React
64
36
 
65
- Uploads retry transient failures automatically (3 retries by default, exponential backoff with jitter). Pass `retry: false` to disable, or customize:
66
-
67
- ```ts
68
- const handle = manager.uploadFile(file, {
69
- path: `uploads/${file.name}`,
70
- retry: { maxRetries: 5, initialDelayMs: 700 },
71
- });
37
+ ```tsx
38
+ import { useStorageManager, useUpload } from "firebase-storage-kit/react";
72
39
 
73
- handle.on("retry", ({ attempt, maxAttempts, delayMs, error }) => {
74
- console.log(`Retry ${attempt}/${maxAttempts} in ${delayMs}ms`, error.message);
75
- });
40
+ const manager = useStorageManager(storage);
41
+ const handle = manager.uploadFile(file, { path: `uploads/${file.name}` });
42
+ const upload = useUpload(handle);
76
43
  ```
77
44
 
78
- ### Querying files
79
-
80
- ```ts
81
- const exists = await manager.exists("uploads/photo.jpg");
82
-
83
- if (exists) {
84
- const meta = await manager.getMetadata("uploads/photo.jpg");
85
- const url = await manager.getDownloadURL("uploads/photo.jpg");
86
- console.log(meta.size, url);
87
- }
45
+ See [React hooks](https://firebase-storage-kit.vercel.app/docs/guides/react-hooks).
88
46
 
89
- await manager.delete("uploads/old.jpg");
90
- ```
47
+ ## Learn more
91
48
 
92
- `exists` returns `false` only when the object is not found. Permission and network errors are thrown.
49
+ - [Single upload](https://firebase-storage-kit.vercel.app/docs/getting-started/single-upload)
50
+ - [Batch uploads](https://firebase-storage-kit.vercel.app/docs/guides/batch-uploads)
51
+ - [API reference](https://firebase-storage-kit.vercel.app/docs/api/storage-manager)
52
+ - [Troubleshooting](https://firebase-storage-kit.vercel.app/docs/troubleshooting)
93
53
 
94
54
  ## License
95
55