Open-Source Firebase Extension • Cloud Firestore

Trigger Official WhatsApp Messages From Cloud Firestore Writes

Install the open-source WhatsBox Firebase Extension (firestore-send-whatsapp-message) to automatically send Meta-approved WhatsApp template messages whenever documents are added to Cloud Firestore.
Open-Source Firebase Extension Zero Backend Glue Code Auto Status Writeback 50% Lower Fee Than Twilio
whatsb/firestore-send-whatsapp-message
import { getFirestore, collection, addDoc } from "firebase/firestore";

const db = getFirestore();

// Writing a document automatically triggers a WhatsApp template message
await addDoc(collection(db, "whatsapp_outbox"), {
  to: "+16317471111",
  template: {
    name: "order_confirmation",
    language: "en",
    components: [
      {
        type: "body",
        parameters: [
          { type: "text", text: "Alex" },
          { type: "text", text: "ORD-9842" }
        ]
      }
    ]
  }
});

Simple Configuration, Full Delivery Observability

Configure three extension parameters once and inspect live delivery status right on your Firestore document.

Extension Parameters

  • WHATSBOX_API_KEY

    Workspace API key created under Settings > API Keys in WhatsBox (stored securely as a Firebase secret).

  • WHATSAPP_CHANNEL_ID

    Internal WhatsApp channel ID copied from WhatsApp Numbers in your WhatsBox workspace.

  • COLLECTION_PATH

    The Cloud Firestore collection watched for new message documents (e.g., whatsapp_outbox).

Automatic Document Status Fields

  • delivery_status

    Automatically set to PENDING, SUCCESS, or ERROR as the Cloud Function executes.

  • whatsbox_message_id

    Unique WhatsBox / WhatsApp tracking ID for correlating with delivery webhooks.

  • processed_at

    Firestore server timestamp recording exact processing time.

  • error

    Actionable diagnostic message logged if dispatch fails (e.g., invalid number or inactive key).

Ship Serverless WhatsApp Notifications in 3 Steps

Zero custom Cloud Functions to maintain — deploy straight from Firebase CLI.
01

Install via Firebase CLI

Run firebase ext:install whatsb/firestore-send-whatsapp-message against your Blaze-plan Firebase project.

02

Add API Key, Channel & Collection

Provide WHATSBOX_API_KEY, WHATSAPP_CHANNEL_ID, and COLLECTION_PATH, and secure writes with Firestore Security Rules.

03

Write Documents to Send WhatsApp

Any addDoc() write into your watched collection dispatches an approved WhatsApp template and writes delivery_status right back.

Frequently Asked Questions

Answers for Firebase developers integrating WhatsBox.

Send WhatsApp Messages Straight From Cloud Firestore

Start free with $0 monthly base fees, $0.0025/message pricing, 0% Meta markup, and a complete Shared Inbox for customer replies.