| Export | Description |
|---|
initFirekit(config) | Initialize Firebase. Call once before your app renders. |
getFirekitConfig() | Return the active Firebase config object. |
isFirekitConfigured() | Return true if initFirekit has been called. |
Singleton service for auth operations.
| Method | Signature | Description |
|---|
signInWithEmail | (email, password) → Promise<UserCredential> | Sign in with email & password |
signInWithGoogle | () → Promise<UserCredential> | Sign in with Google (popup) |
signInWithGithub | () → Promise<UserCredential> | Sign in with GitHub (popup) |
signInWithFacebook | () → Promise<UserCredential> | Sign in with Facebook (popup) |
signInWithApple | () → Promise<UserCredential> | Sign in with Apple (popup) |
signInWithTwitter | () → Promise<UserCredential> | Sign in with Twitter (popup) |
signInWithMicrosoft | () → Promise<UserCredential> | Sign in with Microsoft (popup) |
signInWithGoogleRedirect | () → Promise<void> | Sign in with Google (redirect) |
getRedirectResult | () → Promise<UserCredential | null> | Resolve pending redirect |
signInWithSAML | (providerId) → Promise<UserCredential> | Sign in with SAML provider |
signInWithOIDC | (providerId, scopes?) → Promise<UserCredential> | Sign in with OIDC provider |
signInWithPhoneNumber | (phone, containerId) → Promise<{ confirm }> | Start phone sign-in |
signInAnonymously | () → Promise<UserCredential> | Anonymous sign-in |
signInWithCustomToken | (token) → Promise<UserCredential> | Sign in with a custom token |
registerWithEmail | (email, password, displayName?) → Promise<UserCredential> | Create an account |
updateUserProfile | (profile) → Promise<void> | Update display name / photo URL |
updateEmail | (newEmail) → Promise<void> | Change email address |
updatePassword | (newPassword, currentPassword) → Promise<void> | Change password |
sendPasswordReset | (email) → Promise<void> | Send password reset email |
sendEmailVerification | () → Promise<void> | Send verification email |
signOut | () → Promise<void> | Sign out |
deleteAccount | (password?) → Promise<void> | Delete the current account |
startPhoneMFAEnrollment | (phone, containerId) → Promise<string> | Begin phone MFA enrollment |
completeMFAEnrollment | (verificationId, code, displayName?) → Promise<void> | Finish MFA enrollment |
getMFAEnrolledFactors | () → MultiFactorInfo[] | List enrolled MFA factors |
unenrollMFA | (factor) → Promise<void> | Remove an MFA factor |
getMFAResolver | (error) → MultiFactorResolver | Get resolver from MFA error |
startMFASignIn | (resolver, factorIndex, containerId) → Promise<string> | Start MFA sign-in challenge |
completeMFASignIn | (resolver, verificationId, code) → Promise<UserCredential> | Complete MFA sign-in |
Reactive singleton reflecting the current auth state.
| Property | Type | Description |
|---|
user | UserProfile | null | Current user profile |
loading | boolean | true until the first auth state is received |
isAuthenticated | boolean | Signed in and not anonymous |
isAnonymous | boolean | Anonymous session |
initialized | boolean | true after the first auth state |
| Method | Signature | Description |
|---|
waitForAuth | () → Promise<UserProfile | null> | Resolves when auth state is known |
Returns a FirekitDoc<T> instance.
| Property | Type | Description |
|---|
data | T | null | Document data |
loading | boolean | Loading state |
error | Error | null | Error state |
exists | boolean | Whether the document exists |
metadata | SnapshotMetadata | null | Firestore snapshot metadata |
| Method | Signature | Description |
|---|
setPath | (path: string) → void | Switch to a new document path |
Returns a FirekitDoc<T> instance with metadata enabled. Provides access to Firestore snapshot metadata such as fromCache and hasPendingWrites.
| Property | Type | Description |
|---|
data | T | null | Document data |
loading | boolean | Loading state |
error | Error | null | Error state |
metadata | SnapshotMetadata | Snapshot metadata (fromCache, hasPendingWrites) |
One-time fetch. Same properties as firekitDoc, no live listener.
Returns a FirekitCollection<T> instance.
| Property | Type | Description |
|---|
data | T[] | Document array |
loading | boolean | Loading state |
error | Error | null | Error state |
count | number | Number of documents |
currentPage | number | Active page (when paginated) |
hasMore | boolean | Whether more pages exist |
| Method | Signature | Description |
|---|
setPagination | (pageSize: number) → Promise<void> | Enable pagination |
nextPage | () → Promise<void> | Load next page |
prevPage | () → Promise<void> | Load previous page |
loadMore | () → Promise<void> | Append next page |
resetPagination | () → Promise<void> | Return to page 1 |
One-time collection fetch.
Reactive collection group query. Same interface as firekitCollection.
| Method | Description |
|---|
.where(field, op, value) | Add a where filter |
.orderBy(field, dir?) | Sort by field |
.limit(n) | Limit results |
.limitToLast(n) | Last N results |
.startAt(...values) | Cursor start (inclusive) |
.startAfter(...values) | Cursor start (exclusive) |
.endAt(...values) | Cursor end (inclusive) |
.endBefore(...values) | Cursor end (exclusive) |
.build() | Return QueryConstraint[] |
| Method | Signature | Description |
|---|
add | (path, data, options?) → Promise<DocumentReference> | Add document |
set | (path, data, options?) → Promise<void> | Set document |
update | (path, data, options?) → Promise<void> | Update fields |
delete | (path) → Promise<void> | Delete document |
exists | (path) → Promise<boolean> | Check existence |
batchOps | (ops: FirekitBatchOp[], options?) → Promise<FirekitBatchResult> | Batch write |
transaction | (fn) → Promise<void> | Run a transaction |
increment | (n) → FieldValue | Atomic increment |
arrayUnion | (...values) → FieldValue | Array union |
arrayRemove | (...values) → FieldValue | Array remove |
deleteField | () → FieldValue | Delete field |
serverTimestamp | () → FieldValue | Server timestamp |
Returns a FirekitNode<T> instance.
| Property/Method | Type | Description |
|---|
data | T | null | Current value |
loading | boolean | Loading state |
set(value) | Promise<void> | Replace value |
update(partial) | Promise<void> | Merge partial update |
fetchOnce() | Promise<T | null> | One-time fetch |
Returns a FirekitNodeList<T> instance.
| Property/Method | Type | Description |
|---|
list | T[] | Ordered list (each item has a key) |
loading | boolean | Loading state |
push(data) | Promise<void> | Push new item |
set(value) | Promise<void> | Set entire node |
update(partial) | Promise<void> | Merge partial update |
remove() | Promise<void> | Delete node |
fetchOnce() | Promise<T[] | null> | One-time fetch |
| Export | Description |
|---|
rtdbServerTimestamp() | RTDB server timestamp |
rtdbIncrement(delta) | Atomic RTDB increment |
| Property | Type | Description |
|---|
url | string | null | Resolved download URL |
loading | boolean | Loading state |
error | Error | null | Error state |
| Property/Method | Type | Description |
|---|
progress | number | 0–100 |
state | UploadState | Current upload state |
downloadURL | string | null | Available on success |
error | Error | null | Error state |
bytesTransferred | number | Bytes uploaded |
totalBytes | number | Total file size |
pause() | void | Pause upload |
resume() | void | Resume upload |
cancel() | void | Cancel upload |
| Property | Type | Description |
|---|
items | StorageReference[] | Files in the directory |
prefixes | StorageReference[] | Sub-directories |
loading | boolean | Loading state |
| Export | Signature | Description |
|---|
deleteFile | (path) → Promise<void> | Delete a file |
getFileMetadata | (path) → Promise<FullMetadata> | Read file metadata |
updateFileMetadata | (path, metadata) → Promise<FullMetadata> | Update metadata |
| Property/Method | Type | Description |
|---|
text | string | Generated text |
loading | boolean | Generating |
error | Error | null | Error state |
generate(prompt) | Promise<void> | Run generation |
| Property/Method | Type | Description |
|---|
text | string | Accumulated tokens |
streaming | boolean | true while streaming |
error | Error | null | Error state |
generate(prompt) | Promise<void> | Start streaming generation |
| Property/Method | Type | Description |
|---|
history | ChatMessage[] | Full conversation |
pendingText | string | Partial streaming response |
streaming | boolean | Streaming in progress |
error | Error | null | Error state |
send(message) | Promise<void> | Send a message |
clearHistory() | void | Reset conversation |
| Export | Description |
|---|
textPart(text) | Create a text content part |
imagePart(base64, mimeType) | Create an image content part from base64 |
imageUrlPart(url) | Create an image content part from URL |
| Field | Type | Description |
|---|
model | string | Model ID (e.g. 'gemini-2.0-flash') |
backend | 'googleai' | 'vertexai' | AI backend (default: 'googleai') |
generationConfig | GenerationConfig | Temperature, topP, max tokens, etc. |
safetySettings | SafetySetting[] | Safety thresholds |
| Property/Method | Type | Description |
|---|
loading | boolean | Call in flight |
error | Error | null | Error state |
result | O | null | Last successful result |
call(input) | Promise<O> | Invoke the function |
Same interface as firekitCallable.
Reactive singleton that tracks browser connectivity, Firestore sync state, and pending writes. Provides manual control to force offline/online mode.
| Property | Type | Description |
|---|
online | boolean | Whether the browser has network connectivity |
synced | boolean | Whether all Firestore snapshots are in sync with the server |
hasPendingWrites | boolean | Whether there are unconfirmed Firestore writes |
initialized | boolean | Whether the network store has been initialized |
error | NetworkError | null | Last error from network operations |
firestoreEnabled | boolean | Whether Firestore network is currently enabled |
| Method | Signature | Description |
|---|
trackWrite | () → void | Mark a pending write (resets when acknowledged) |
goOnline | () → Promise<void> | Re-enable Firestore network access |
goOffline | () → Promise<void> | Force Firestore into offline mode |
clearError | () → void | Clear the last network error |
dispose | () → void | Tear down all listeners |
| Export | Key methods/properties |
|---|
firekitAnalytics | logEvent, setUserId, setUserProperties, logScreenView, setConsent |
firekitMessaging | requestPermission, onMessage, token, permission, supported |
firekitInAppMessaging | suppress, unsuppress, suppressed, supported |
firekitRemoteConfig(options) | fetchAndActivate, getString, getBoolean, getNumber, getValue |
firekitPerformance | startTrace, measure |
firekitPresence | initialize, setPresence, getStats, dispose |
firekitAppCheck | initialize, getToken |
| Export | Signature | Description |
|---|
loadFirestoreBundle | (stream: ReadableStream) → Promise<void> | Load a bundle into the local cache |
getNamedQuery<T> | (name: string) → Promise<Query<T> | null> | Retrieve a named query |