@jebin_t/expense-manager-data-access
v0.1.0
Published
Reusable data access layer for the Expense Manager apps.
Readme
@expense-manager/finance-data
Reusable data access layer for the Expense Manager apps.
What it contains
- Shared Firebase and local-demo data logic
- A configurable runtime for platform-specific auth, storage, and event APIs
- The same function surface the web app already uses
Configure it
import { configureFinanceData } from "@expense-manager/finance-data";
configureFinanceData({
firebase: {
auth,
db,
googleProvider,
isFirebaseConfigured,
},
platform: {
storage,
eventTarget,
CustomEvent,
},
authHandlers: {
signInUser: ({ auth, googleProvider }) => signInWithPopup(auth, googleProvider),
signInAnonymously: ({ auth }) => signInAnonymously(auth),
signOutUser: ({ auth }) => signOut(auth),
},
});React Native note
For React Native, keep Firebase enabled and provide native auth handlers instead of popup auth. The local demo fallback expects a synchronous storage adapter, so in mobile apps it is best treated as optional.
