Getting Started
Firebase Adapter
Use the built-in firebase/firestore adapter.
@frappes/firebase ships an official adapter for firebase/firestore:
adapter.ts
import { getFirestore } from "firebase/firestore"
import { createFirebaseFirestorePort } from "@frappes/firebase"
const db = getFirestore()
export const firestore = createFirebaseFirestorePort(db)
Then pass it to the core client:
client.ts
import { createFirestoreCoreClient } from "@frappes/firebase"
import { firestore } from "./adapter"
export const client = createFirestoreCoreClient({
firestore,
tenantId: "tenant_athens",
locationId: "loc_syntagma",
})
When to build your own port
You can still implement FirestorePort yourself if:
- you use Admin SDK or server-only wrappers
- you need custom retries/metrics/logging behavior
- you want to mock a specialized store in tests