Skip to content

API Reference

ExportDescription
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.

MethodSignatureDescription
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) → MultiFactorResolverGet 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.

PropertyTypeDescription
userUserProfile | nullCurrent user profile
loadingbooleantrue until the first auth state is received
isAuthenticatedbooleanSigned in and not anonymous
isAnonymousbooleanAnonymous session
initializedbooleantrue after the first auth state
MethodSignatureDescription
waitForAuth() → Promise<UserProfile | null>Resolves when auth state is known

Returns a FirekitDoc<T> instance.

PropertyTypeDescription
dataT | nullDocument data
loadingbooleanLoading state
errorError | nullError state
existsbooleanWhether the document exists
metadataSnapshotMetadata | nullFirestore snapshot metadata
MethodSignatureDescription
setPath(path: string) → voidSwitch to a new document path

firekitDocOnce(path, constraints?, options?)

Section titled “firekitDocOnce(path, constraints?, options?)”

One-time fetch. Same properties as firekitDoc, no live listener.

firekitCollection(path, constraints?, options?)

Section titled “firekitCollection(path, constraints?, options?)”

Returns a FirekitCollection<T> instance.

PropertyTypeDescription
dataT[]Document array
loadingbooleanLoading state
errorError | nullError state
countnumberNumber of documents
currentPagenumberActive page (when paginated)
hasMorebooleanWhether more pages exist
MethodSignatureDescription
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

firekitCollectionOnce(path, constraints?, options?)

Section titled “firekitCollectionOnce(path, constraints?, options?)”

One-time collection fetch.

firekitCollectionGroup(collectionId, constraints?, options?)

Section titled “firekitCollectionGroup(collectionId, constraints?, options?)”

Reactive collection group query. Same interface as firekitCollection.

MethodDescription
.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[]
MethodSignatureDescription
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) → FieldValueAtomic increment
arrayUnion(...values) → FieldValueArray union
arrayRemove(...values) → FieldValueArray remove
deleteField() → FieldValueDelete field
serverTimestamp() → FieldValueServer timestamp

Returns a FirekitNode<T> instance.

Property/MethodTypeDescription
dataT | nullCurrent value
loadingbooleanLoading 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/MethodTypeDescription
listT[]Ordered list (each item has a key)
loadingbooleanLoading 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
ExportDescription
rtdbServerTimestamp()RTDB server timestamp
rtdbIncrement(delta)Atomic RTDB increment

PropertyTypeDescription
urlstring | nullResolved download URL
loadingbooleanLoading state
errorError | nullError state
Property/MethodTypeDescription
progressnumber0–100
stateUploadStateCurrent upload state
downloadURLstring | nullAvailable on success
errorError | nullError state
bytesTransferrednumberBytes uploaded
totalBytesnumberTotal file size
pause()voidPause upload
resume()voidResume upload
cancel()voidCancel upload
PropertyTypeDescription
itemsStorageReference[]Files in the directory
prefixesStorageReference[]Sub-directories
loadingbooleanLoading state
ExportSignatureDescription
deleteFile(path) → Promise<void>Delete a file
getFileMetadata(path) → Promise<FullMetadata>Read file metadata
updateFileMetadata(path, metadata) → Promise<FullMetadata>Update metadata

Property/MethodTypeDescription
textstringGenerated text
loadingbooleanGenerating
errorError | nullError state
generate(prompt)Promise<void>Run generation
Property/MethodTypeDescription
textstringAccumulated tokens
streamingbooleantrue while streaming
errorError | nullError state
generate(prompt)Promise<void>Start streaming generation
Property/MethodTypeDescription
historyChatMessage[]Full conversation
pendingTextstringPartial streaming response
streamingbooleanStreaming in progress
errorError | nullError state
send(message)Promise<void>Send a message
clearHistory()voidReset conversation
ExportDescription
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
FieldTypeDescription
modelstringModel ID (e.g. 'gemini-2.0-flash')
backend'googleai' | 'vertexai'AI backend (default: 'googleai')
generationConfigGenerationConfigTemperature, topP, max tokens, etc.
safetySettingsSafetySetting[]Safety thresholds

Property/MethodTypeDescription
loadingbooleanCall in flight
errorError | nullError state
resultO | nullLast successful result
call(input)Promise<O>Invoke the function

Same interface as firekitCallable.


ExportKey methods/properties
firekitAnalyticslogEvent, setUserId, setUserProperties, logScreenView, setConsent
firekitMessagingrequestPermission, onMessage, token, permission, supported
firekitInAppMessagingsuppress, unsuppress, suppressed, supported
firekitRemoteConfig(options)fetchAndActivate, getString, getBoolean, getNumber, getValue
firekitPerformancestartTrace, measure
firekitPresenceinitialize, setPresence, getStats, dispose
firekitAppCheckinitialize, getToken

ExportSignatureDescription
loadFirestoreBundle(stream: ReadableStream) → Promise<void>Load a bundle into the local cache
getNamedQuery<T>(name: string) → Promise<Query<T> | null>Retrieve a named query