DEV Community

Cover image for flame-core v1.1.0 — More Firebase, Less Boilerplate
Abhijith P Subash
Abhijith P Subash

Posted on

flame-core v1.1.0 — More Firebase, Less Boilerplate

If you've ever wired up Firebase from scratch — config init, auth boilerplate, Firestore queries, storage uploads — you know how much repetitive scaffolding it takes. That's exactly what flame-core was built to fix.

v1.1.0 is out now. Here's what changed.


What's flame-core?

A modular npm package that abstracts Firebase into clean, typed service functions. One import, one method call, done.

npm install flame-core
Enter fullscreen mode Exit fullscreen mode
import { firebaseConfig, fireAuthService, fireStoreDatabaseService } from 'flame-core';

firebaseConfig.initialize({ apiKey: "...", projectId: "...", ... });

const auth = fireAuthService();
const db = fireStoreDatabaseService();
Enter fullscreen mode Exit fullscreen mode

What's new in 1.1.0

4 new modules

Module What it does
fireRealtimeDatabaseService RTDB — presence, counters, live chat
fireFunctionsService Callable Cloud Functions with one method
fireMessagingService FCM — tokens, foreground messages
fireAnalyticsService GA4 — events, user props, consent control

Firestore got smarter

getCount now uses server-side aggregation (getCountFromServer) — no more downloading every document just to count them. Also correctly respects where filters now.

updateBulk / deleteBulk are atomic — auto-chunked batched writes at Firestore's 500-op limit instead of firing independent requests.

New Firestore APIs:

  • set — write with a custom id, with optional merge
  • createBulk — batch insert
  • subscribe / subscribeToDoc — real-time listeners
  • transaction — atomic read-modify-write
  • Atomic field helpers: serverTimestamp(), increment(n), arrayUnion(), arrayRemove()

Expanded Auth

Email verification, secure email change (verifyBeforeUpdateEmail), anonymous sign-in, custom token, passwordless email-link, profile updates, account deletion, ID-token retrieval, configurable persistence. All the flows you actually need.

Expanded Storage

Resumable uploads with progress callbacks, uploadString for base64/data URLs, metadata read/update, and folder listing.


Quick examples

Real-time listener on Firestore:

const unsubscribe = db.subscribe(
  "orders",
  (data) => console.log("Live orders:", data),
  { options: { where: { status: "pending" }, sort: [["createdAt", "desc"]], limit: 20 } }
);
Enter fullscreen mode Exit fullscreen mode

RTDB presence:

const rtdb = fireRealtimeDatabaseService();
await rtdb.set("status/user1", { online: true, lastSeen: rtdb.serverTimestamp() });
Enter fullscreen mode Exit fullscreen mode

Call a Cloud Function:

const functions = fireFunctionsService();
const res = await functions.call("createOrder", { items: [1, 2, 3] });
Enter fullscreen mode Exit fullscreen mode

Atomic increment:

await db.updateById("posts", {
  id: "post-1",
  body: { views: db.increment(1) },
});
Enter fullscreen mode Exit fullscreen mode

All changes are backward compatible

Existing code works as-is. Enable debug logging during development:

import { setDebug } from 'flame-core';
setDebug(true);
Enter fullscreen mode Exit fullscreen mode

Links

If it saves you boilerplate, drop a ⭐ on the repo. 🔥

Top comments (0)