svelte-firekit 0.0.25 → 0.1.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.
Files changed (95) hide show
  1. package/README.md +445 -213
  2. package/dist/components/Collection.svelte +150 -0
  3. package/dist/components/Collection.svelte.d.ts +27 -0
  4. package/dist/components/Ddoc.svelte +131 -0
  5. package/dist/components/Ddoc.svelte.d.ts +28 -0
  6. package/dist/components/Node.svelte +97 -0
  7. package/dist/components/Node.svelte.d.ts +23 -0
  8. package/dist/components/auth-guard.svelte +89 -0
  9. package/dist/components/auth-guard.svelte.d.ts +26 -0
  10. package/dist/components/custom-guard.svelte +122 -0
  11. package/dist/components/custom-guard.svelte.d.ts +31 -0
  12. package/dist/components/download-url.svelte +92 -0
  13. package/dist/components/download-url.svelte.d.ts +19 -0
  14. package/dist/components/firebase-app.svelte +30 -0
  15. package/dist/components/firebase-app.svelte.d.ts +7 -0
  16. package/dist/components/node-list.svelte +102 -0
  17. package/dist/components/node-list.svelte.d.ts +27 -0
  18. package/dist/components/signed-in.svelte +42 -0
  19. package/dist/components/signed-in.svelte.d.ts +11 -0
  20. package/dist/components/signed-out.svelte +42 -0
  21. package/dist/components/signed-out.svelte.d.ts +11 -0
  22. package/dist/components/storage-list.svelte +97 -0
  23. package/dist/components/storage-list.svelte.d.ts +26 -0
  24. package/dist/components/upload-task.svelte +108 -0
  25. package/dist/components/upload-task.svelte.d.ts +24 -0
  26. package/dist/config.js +17 -39
  27. package/dist/firebase.d.ts +43 -21
  28. package/dist/firebase.js +121 -35
  29. package/dist/index.d.ts +21 -13
  30. package/dist/index.js +27 -15
  31. package/dist/services/auth.d.ts +389 -0
  32. package/dist/services/auth.js +824 -0
  33. package/dist/services/collection.svelte.d.ts +286 -0
  34. package/dist/services/collection.svelte.js +871 -0
  35. package/dist/services/document.svelte.d.ts +288 -0
  36. package/dist/services/document.svelte.js +555 -0
  37. package/dist/services/mutations.d.ts +336 -0
  38. package/dist/services/mutations.js +1079 -0
  39. package/dist/services/presence.svelte.d.ts +141 -0
  40. package/dist/services/presence.svelte.js +727 -0
  41. package/dist/{realtime → services}/realtime.svelte.d.ts +3 -1
  42. package/dist/{realtime → services}/realtime.svelte.js +13 -7
  43. package/dist/services/storage.svelte.d.ts +257 -0
  44. package/dist/services/storage.svelte.js +374 -0
  45. package/dist/services/user.svelte.d.ts +290 -0
  46. package/dist/services/user.svelte.js +533 -0
  47. package/dist/types/auth.d.ts +158 -0
  48. package/dist/types/auth.js +106 -0
  49. package/dist/types/collection.d.ts +360 -0
  50. package/dist/types/collection.js +167 -0
  51. package/dist/types/document.d.ts +342 -0
  52. package/dist/types/document.js +148 -0
  53. package/dist/types/firebase.d.ts +44 -0
  54. package/dist/types/firebase.js +33 -0
  55. package/dist/types/index.d.ts +6 -0
  56. package/dist/types/index.js +4 -0
  57. package/dist/types/mutations.d.ts +387 -0
  58. package/dist/types/mutations.js +205 -0
  59. package/dist/types/presence.d.ts +282 -0
  60. package/dist/types/presence.js +80 -0
  61. package/dist/utils/errors.d.ts +21 -0
  62. package/dist/utils/errors.js +35 -0
  63. package/dist/utils/firestore.d.ts +9 -0
  64. package/dist/utils/firestore.js +33 -0
  65. package/dist/utils/index.d.ts +4 -0
  66. package/dist/utils/index.js +8 -0
  67. package/dist/utils/providers.d.ts +16 -0
  68. package/dist/utils/providers.js +30 -0
  69. package/dist/utils/user.d.ts +8 -0
  70. package/dist/utils/user.js +29 -0
  71. package/package.json +65 -65
  72. package/dist/auth/auth.d.ts +0 -117
  73. package/dist/auth/auth.js +0 -194
  74. package/dist/auth/presence.svelte.d.ts +0 -139
  75. package/dist/auth/presence.svelte.js +0 -373
  76. package/dist/auth/user.svelte.d.ts +0 -112
  77. package/dist/auth/user.svelte.js +0 -155
  78. package/dist/firestore/awaitable-doc.svelte.d.ts +0 -141
  79. package/dist/firestore/awaitable-doc.svelte.js +0 -183
  80. package/dist/firestore/batch-mutations.svelte.d.ts +0 -140
  81. package/dist/firestore/batch-mutations.svelte.js +0 -218
  82. package/dist/firestore/collection-group.svelte.d.ts +0 -78
  83. package/dist/firestore/collection-group.svelte.js +0 -120
  84. package/dist/firestore/collection.svelte.d.ts +0 -96
  85. package/dist/firestore/collection.svelte.js +0 -137
  86. package/dist/firestore/doc.svelte.d.ts +0 -90
  87. package/dist/firestore/doc.svelte.js +0 -131
  88. package/dist/firestore/document-mutations.svelte.d.ts +0 -164
  89. package/dist/firestore/document-mutations.svelte.js +0 -273
  90. package/dist/storage/download-url.svelte.d.ts +0 -83
  91. package/dist/storage/download-url.svelte.js +0 -114
  92. package/dist/storage/storage-list.svelte.d.ts +0 -89
  93. package/dist/storage/storage-list.svelte.js +0 -123
  94. package/dist/storage/upload-task.svelte.d.ts +0 -94
  95. package/dist/storage/upload-task.svelte.js +0 -138
package/README.md CHANGED
@@ -1,213 +1,445 @@
1
- Svelte Firekit is a powerful Firebase toolkit for SvelteKit applications, providing a comprehensive set of utilities, stores, and components for seamless Firebase integration. Whether you're building a micro SaaS, web application, or any Firebase-powered project, Svelte Firekit streamlines your development process.
2
-
3
- ## Installation
4
-
5
- ```bash
6
- npm install firebase svelte-firekit
7
- ```
8
-
9
- ## Configuration
10
-
11
- Svelte Firekit automatically manages your Firebase configuration through environment variables. Create a `.env` file in your project root with the following variables:
12
-
13
- ```env
14
- PUBLIC_FIREBASE_API_KEY=your_api_key
15
- PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
16
- PUBLIC_FIREBASE_PROJECT_ID=your_project_id
17
- PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
18
- PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
19
- PUBLIC_FIREBASE_APP_ID=your_app_id
20
- PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id
21
- ```
22
-
23
- The configuration is automatically handled by Firekit - no manual setup required. If any required environment variables are missing, Firekit will throw a helpful error indicating which variables need to be set.
24
-
25
- ## Usage Example
26
-
27
- Here's a simple example showing how to display the current user's name:
28
-
29
- ```svelte
30
- <script>
31
- import { firekitUser } from 'svelte-firekit';
32
- </script>
33
-
34
- Hello {firekitUser.displayName}
35
- ```
36
-
37
- The `firekitUser` store provides access to the current user's information and authentication state.
38
-
39
- ## Core Features
40
-
41
- ### 🔥 Firebase Integration
42
- - Zero-config Firebase setup through environment variables
43
- - Automatic initialization and app management
44
- - Built-in error handling and connection state management
45
- - Type-safe configuration management
46
-
47
- ### 🔐 Authentication
48
- - Complete authentication system with built-in components
49
- - Support for multiple authentication providers:
50
- - Email/Password
51
- - Google
52
- - GitHub
53
- - Custom providers
54
- - User state management and persistence through `firekitUser` store
55
-
56
- ### 📚 Firestore Integration
57
- - Reactive data stores for real-time updates
58
- - Simplified CRUD operations
59
- - Batch operations and transactions
60
- - Type-safe document references
61
- - Automatic data serialization/deserialization
62
-
63
- ### 📦 Storage Management
64
- - File upload and download utilities
65
- - Progress tracking and status updates
66
- - Storage security rules helpers
67
- - Image optimization utilities
68
-
69
- ### ⚡ Server-Side Rendering
70
- - Full SSR compatibility
71
- - Hydration support
72
- - Server-side data fetching
73
- - SEO-friendly rendering
74
-
75
- ### 🎯 Type Safety
76
- - Built with TypeScript
77
- - Complete type definitions
78
- - Intelligent autocomplete
79
- - Runtime type checking
80
- - Type-safe Firestore operations
81
-
82
- ## Why Svelte Firekit?
83
-
84
- - **Zero Configuration**: Automatic Firebase setup through environment variables
85
- - **Type Safety**: Full TypeScript support with built-in type checking
86
- - **Rapid Development**: Get your Firebase-powered SvelteKit application up and running in minutes
87
- - **Best Practices**: Built following Firebase and SvelteKit best practices
88
- - **Production Ready**: Battle-tested in production environments
89
- - **Active Community**: Regular updates and active community support
90
- - **Extensible**: Easy to customize and extend for your specific needs
91
-
92
- ## Next Steps
93
-
94
- - Check out our [Getting Started](/getting-started) guide
95
- - Explore the [API Reference](/api)
96
- - View [Examples](/examples)
97
- - Join our [Community](/community)
98
-
99
- ## Contributing
100
-
101
- We welcome contributions! Please see our [Contributing Guide](/contributing) for more details.
102
-
103
- ## License
104
-
105
- Svelte Firekit is released under the MIT License. See the [LICENSE](/license) file for more details.
106
-
107
- # Authentication
108
-
109
- Svelte Firekit provides a comprehensive authentication system through the `firekitAuth` singleton, offering various authentication methods and user management features.
110
-
111
- ## Basic Usage
112
-
113
- ```typescript
114
- import { firekitAuth } from 'svelte-firekit';
115
- ```
116
-
117
- ## Authentication Methods
118
-
119
- ### Google Authentication
120
-
121
- ```typescript
122
- await firekitAuth.signInWithGoogle();
123
- ```
124
-
125
- ### Email/Password Authentication
126
-
127
- ```typescript
128
- // Sign in
129
- await firekitAuth.signInWithEmail(email, password);
130
-
131
- // Register
132
- await firekitAuth.registerWithEmail(email, password, displayName);
133
-
134
- // Sign out
135
- await firekitAuth.logOut();
136
- ```
137
-
138
- ## User Management
139
-
140
- ### Password Management
141
-
142
- ```typescript
143
- // Send password reset email
144
- await firekitAuth.sendPasswordReset(email);
145
-
146
- // Update password (requires reauthentication)
147
- await firekitAuth.updateUserPassword(newPassword, currentPassword);
148
- ```
149
-
150
- ### Profile Management
151
-
152
- ```typescript
153
- // Update user profile
154
- await firekitAuth.updateUserProfile({
155
- displayName: "New Name",
156
- photoURL: "https://example.com/photo.jpg"
157
- });
158
- ```
159
-
160
- ### Email Verification
161
-
162
- ```typescript
163
- // Send verification email
164
- await firekitAuth.sendEmailVerificationToUser();
165
- ```
166
-
167
- ### Account Deletion
168
-
169
- ```typescript
170
- // Delete user account
171
- await firekitAuth.deleteUserAccount();
172
- ```
173
-
174
- ## Automatic Firestore Integration
175
-
176
- The authentication system automatically maintains a user document in Firestore with the following information:
177
- - User ID
178
- - Email
179
- - Email verification status
180
- - Display name
181
- - Photo URL
182
- - Authentication provider information
183
- - Anonymous status
184
-
185
- ## Error Handling
186
-
187
- All methods include proper error handling and return appropriate error messages. For example, password updates will return:
188
-
189
- ```typescript
190
- {
191
- success: boolean;
192
- message: string;
193
- code?: string; // In case of errors
194
- }
195
- ```
196
-
197
- ## Features
198
-
199
- - 🔐 Multiple authentication providers
200
- - 📝 Automatic user profile management
201
- - 🔄 Password reset and update functionality
202
- - ✉️ Email verification
203
- - 🗑️ Account deletion
204
- - 🔄 Reauthentication support
205
- - 📚 Automatic Firestore user document management
206
- - Type-safe operations
207
-
208
- ## Important Notes
209
-
210
- 1. User data is automatically synchronized with Firestore
211
- 2. Password updates require current password verification
212
- 3. Account deletion removes both authentication and Firestore data
213
- 4. All operations are fully typed for TypeScript support
1
+ # Svelte Firekit
2
+
3
+ Svelte Firekit is a powerful Firebase toolkit for SvelteKit applications, providing a comprehensive set of utilities, stores, and components for seamless Firebase integration. Whether you're building a micro SaaS, web application, or any Firebase-powered project, Svelte Firekit streamlines your development process.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install firebase svelte-firekit
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ Svelte Firekit automatically manages your Firebase configuration through environment variables. Create a `.env` file in your project root with the following variables:
14
+
15
+ ```env
16
+ PUBLIC_FIREBASE_API_KEY=your_api_key
17
+ PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
18
+ PUBLIC_FIREBASE_PROJECT_ID=your_project_id
19
+ PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
20
+ PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
21
+ PUBLIC_FIREBASE_APP_ID=your_app_id
22
+ PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id
23
+ ```
24
+
25
+ The configuration is automatically handled by Firekit - no manual setup required. If any required environment variables are missing, Firekit will throw a helpful error indicating which variables need to be set.
26
+
27
+ ## Usage Example
28
+
29
+ Here's a simple example showing how to display the current user's name:
30
+
31
+ ```svelte
32
+ <script>
33
+ import { firekitUser } from 'svelte-firekit';
34
+ </script>
35
+
36
+ Hello {firekitUser.displayName}
37
+ ```
38
+
39
+ The `firekitUser` store provides access to the current user's information and authentication state.
40
+
41
+ ## Core Features
42
+
43
+ ### 🔥 Firebase Integration
44
+
45
+ - Zero-config Firebase setup through environment variables
46
+ - Automatic initialization and app management
47
+ - Built-in error handling and connection state management
48
+ - Type-safe configuration management
49
+
50
+ ### 🔐 Authentication
51
+
52
+ - Complete authentication system with built-in components
53
+ - Support for multiple authentication providers:
54
+ - Email/Password
55
+ - Google
56
+ - GitHub
57
+ - Custom providers
58
+ - User state management and persistence through `firekitUser` store
59
+
60
+ ### 📚 Firestore Integration
61
+
62
+ - Reactive data stores for real-time updates
63
+ - Simplified CRUD operations
64
+ - Batch operations and transactions
65
+ - Type-safe document references
66
+ - Automatic data serialization/deserialization
67
+
68
+ ### 📦 Storage Management
69
+
70
+ - File upload and download utilities
71
+ - Progress tracking and status updates
72
+ - Storage security rules helpers
73
+ - Image optimization utilities
74
+
75
+ ### Server-Side Rendering
76
+
77
+ - Full SSR compatibility
78
+ - Hydration support
79
+ - Server-side data fetching
80
+ - SEO-friendly rendering
81
+
82
+ ### 🎯 Type Safety
83
+
84
+ - Built with TypeScript
85
+ - Complete type definitions
86
+ - Intelligent autocomplete
87
+ - Runtime type checking
88
+ - Type-safe Firestore operations
89
+
90
+ ## Components
91
+
92
+ Svelte Firekit provides a comprehensive set of Svelte components for easy Firebase integration:
93
+
94
+ ### 🔧 Core Components
95
+
96
+ #### `FirebaseApp`
97
+
98
+ The root component that initializes Firebase and provides context to child components.
99
+
100
+ ```svelte
101
+ <script>
102
+ import { FirebaseApp } from 'svelte-firekit';
103
+ </script>
104
+
105
+ <FirebaseApp let:children>
106
+ <!-- Your app content here -->
107
+ </FirebaseApp>
108
+ ```
109
+
110
+ ### 🔐 Authentication Components
111
+
112
+ #### `AuthGuard`
113
+
114
+ Protects routes and content based on authentication state.
115
+
116
+ ```svelte
117
+ <script>
118
+ import { AuthGuard } from 'svelte-firekit';
119
+ </script>
120
+
121
+ <AuthGuard requireAuth={true} redirectTo="/login" let:children let:user let:auth let:signOut>
122
+ <h1>Welcome, {user.displayName}!</h1>
123
+ <button on:click={signOut}>Sign Out</button>
124
+ </AuthGuard>
125
+ ```
126
+
127
+ #### `SignedIn`
128
+
129
+ Renders content only when a user is signed in.
130
+
131
+ ```svelte
132
+ <script>
133
+ import { SignedIn } from 'svelte-firekit';
134
+ </script>
135
+
136
+ <SignedIn let:children let:user>
137
+ <p>Hello, {user.displayName}!</p>
138
+ </SignedIn>
139
+ ```
140
+
141
+ #### `SignedOut`
142
+
143
+ Renders content only when no user is signed in.
144
+
145
+ ```svelte
146
+ <script>
147
+ import { SignedOut } from 'svelte-firekit';
148
+ </script>
149
+
150
+ <SignedOut let:children let:auth>
151
+ <button on:click={() => signInWithGoogle()}>Sign In</button>
152
+ </SignedOut>
153
+ ```
154
+
155
+ #### `CustomGuard`
156
+
157
+ Advanced authentication guard with custom verification checks.
158
+
159
+ ```svelte
160
+ <script>
161
+ import { CustomGuard } from 'svelte-firekit';
162
+
163
+ const emailVerificationCheck = (user) => user.emailVerified;
164
+ </script>
165
+
166
+ <CustomGuard
167
+ verificationChecks={[emailVerificationCheck]}
168
+ redirectTo="/verify-email"
169
+ let:children
170
+ let:user
171
+ let:auth
172
+ let:signOut
173
+ >
174
+ <p>Your email is verified!</p>
175
+ </CustomGuard>
176
+ ```
177
+
178
+ ### 📚 Firestore Components
179
+
180
+ #### `Collection`
181
+
182
+ Reactive component for Firestore collections with real-time updates.
183
+
184
+ ```svelte
185
+ <script>
186
+ import { Collection } from 'svelte-firekit';
187
+ </script>
188
+
189
+ <Collection ref="users" let:children let:data let:ref let:firestore let:count>
190
+ {#each data as user}
191
+ <div>{user.name}</div>
192
+ {/each}
193
+ <p>Total users: {count}</p>
194
+ </Collection>
195
+ ```
196
+
197
+ #### `Ddoc`
198
+
199
+ Reactive component for individual Firestore documents.
200
+
201
+ ```svelte
202
+ <script>
203
+ import { Ddoc } from 'svelte-firekit';
204
+ </script>
205
+
206
+ <Ddoc ref="users/123" let:children let:data let:ref let:firestore>
207
+ {#if data}
208
+ <h1>{data.name}</h1>
209
+ <p>{data.email}</p>
210
+ {/if}
211
+ </Ddoc>
212
+ ```
213
+
214
+ ### 📦 Storage Components
215
+
216
+ #### `UploadTask`
217
+
218
+ Handles file uploads with progress tracking.
219
+
220
+ ```svelte
221
+ <script>
222
+ import { UploadTask } from 'svelte-firekit';
223
+
224
+ let file;
225
+ </script>
226
+
227
+ <input type="file" bind:files={file} />
228
+
229
+ <UploadTask
230
+ ref="images/{file.name}"
231
+ data={file}
232
+ let:children
233
+ let:snapshot
234
+ let:task
235
+ let:progress
236
+ let:storage
237
+ >
238
+ <div>Upload Progress: {progress}%</div>
239
+ {#if snapshot?.state === 'success'}
240
+ <p>Upload complete!</p>
241
+ {/if}
242
+ </UploadTask>
243
+ ```
244
+
245
+ #### `DownloadUrl`
246
+
247
+ Retrieves download URLs for storage files.
248
+
249
+ ```svelte
250
+ <script>
251
+ import { DownloadUrl } from 'svelte-firekit';
252
+ </script>
253
+
254
+ <DownloadUrl ref="images/profile.jpg" let:children let:url let:ref let:storage>
255
+ <img src={url} alt="Profile" />
256
+ </DownloadUrl>
257
+ ```
258
+
259
+ #### `StorageList`
260
+
261
+ Lists files and folders in Firebase Storage.
262
+
263
+ ```svelte
264
+ <script>
265
+ import { StorageList } from 'svelte-firekit';
266
+ </script>
267
+
268
+ <StorageList ref="images" let:children let:list let:ref let:storage>
269
+ {#each list.items as item}
270
+ <div>{item.name}</div>
271
+ {/each}
272
+ {#each list.prefixes as prefix}
273
+ <div>📁 {prefix.name}</div>
274
+ {/each}
275
+ </StorageList>
276
+ ```
277
+
278
+ ### 🔄 Realtime Database Components
279
+
280
+ #### `Node`
281
+
282
+ Reactive component for Realtime Database nodes.
283
+
284
+ ```svelte
285
+ <script>
286
+ import { Node } from 'svelte-firekit';
287
+ </script>
288
+
289
+ <Node path="users/123" let:children let:data let:ref let:database>
290
+ {#if data}
291
+ <h1>{data.name}</h1>
292
+ <p>Status: {data.status}</p>
293
+ {/if}
294
+ </Node>
295
+ ```
296
+
297
+ #### `NodeList`
298
+
299
+ Reactive component for Realtime Database lists.
300
+
301
+ ```svelte
302
+ <script>
303
+ import { NodeList } from 'svelte-firekit';
304
+ </script>
305
+
306
+ <NodeList path="users" let:children let:data let:ref let:database>
307
+ {#each data as user}
308
+ <div>{user.name} - {user.status}</div>
309
+ {/each}
310
+ </NodeList>
311
+ ```
312
+
313
+ ## Why Svelte Firekit?
314
+
315
+ - **Zero Configuration**: Automatic Firebase setup through environment variables
316
+ - **Type Safety**: Full TypeScript support with built-in type checking
317
+ - **Rapid Development**: Get your Firebase-powered SvelteKit application up and running in minutes
318
+ - **Best Practices**: Built following Firebase and SvelteKit best practices
319
+ - **Production Ready**: Battle-tested in production environments
320
+ - **Active Community**: Regular updates and active community support
321
+ - **Extensible**: Easy to customize and extend for your specific needs
322
+
323
+ ## Next Steps
324
+
325
+ - Check out our [Getting Started](/getting-started) guide
326
+ - Explore the [API Reference](/api)
327
+ - View [Examples](/examples)
328
+ - Join our [Community](/community)
329
+
330
+ ## Contributing
331
+
332
+ We welcome contributions! Please see our [Contributing Guide](/contributing) for more details.
333
+
334
+ ## License
335
+
336
+ Svelte Firekit is released under the MIT License. See the [LICENSE](/license) file for more details.
337
+
338
+ # Authentication
339
+
340
+ Svelte Firekit provides a comprehensive authentication system through the `firekitAuth` singleton, offering various authentication methods and user management features.
341
+
342
+ ## Basic Usage
343
+
344
+ ```typescript
345
+ import { firekitAuth } from 'svelte-firekit';
346
+ ```
347
+
348
+ ## Authentication Methods
349
+
350
+ ### Google Authentication
351
+
352
+ ```typescript
353
+ await firekitAuth.signInWithGoogle();
354
+ ```
355
+
356
+ ### Email/Password Authentication
357
+
358
+ ```typescript
359
+ // Sign in
360
+ await firekitAuth.signInWithEmail(email, password);
361
+
362
+ // Register
363
+ await firekitAuth.registerWithEmail(email, password, displayName);
364
+
365
+ // Sign out
366
+ await firekitAuth.logOut();
367
+ ```
368
+
369
+ ## User Management
370
+
371
+ ### Password Management
372
+
373
+ ```typescript
374
+ // Send password reset email
375
+ await firekitAuth.sendPasswordReset(email);
376
+
377
+ // Update password (requires reauthentication)
378
+ await firekitAuth.updateUserPassword(newPassword, currentPassword);
379
+ ```
380
+
381
+ ### Profile Management
382
+
383
+ ```typescript
384
+ // Update user profile
385
+ await firekitAuth.updateUserProfile({
386
+ displayName: 'New Name',
387
+ photoURL: 'https://example.com/photo.jpg'
388
+ });
389
+ ```
390
+
391
+ ### Email Verification
392
+
393
+ ```typescript
394
+ // Send verification email
395
+ await firekitAuth.sendEmailVerificationToUser();
396
+ ```
397
+
398
+ ### Account Deletion
399
+
400
+ ```typescript
401
+ // Delete user account
402
+ await firekitAuth.deleteUserAccount();
403
+ ```
404
+
405
+ ## Automatic Firestore Integration
406
+
407
+ The authentication system automatically maintains a user document in Firestore with the following information:
408
+
409
+ - User ID
410
+ - Email
411
+ - Email verification status
412
+ - Display name
413
+ - Photo URL
414
+ - Authentication provider information
415
+ - Anonymous status
416
+
417
+ ## Error Handling
418
+
419
+ All methods include proper error handling and return appropriate error messages. For example, password updates will return:
420
+
421
+ ```typescript
422
+ {
423
+ success: boolean;
424
+ message: string;
425
+ code?: string; // In case of errors
426
+ }
427
+ ```
428
+
429
+ ## Features
430
+
431
+ - 🔐 Multiple authentication providers
432
+ - 📝 Automatic user profile management
433
+ - 🔄 Password reset and update functionality
434
+ - ✉️ Email verification
435
+ - 🗑️ Account deletion
436
+ - 🔄 Reauthentication support
437
+ - 📚 Automatic Firestore user document management
438
+ - ⚡ Type-safe operations
439
+
440
+ ## Important Notes
441
+
442
+ 1. User data is automatically synchronized with Firestore
443
+ 2. Password updates require current password verification
444
+ 3. Account deletion removes both authentication and Firestore data
445
+ 4. All operations are fully typed for TypeScript support