Step-by-Step Guide to Adding a Custom Chat Box in Blogger using Firebase
This guide will help you create a real-time chat box in your Blogger site where users can send messages, links, and files (PDF, DOC, CBZ, Images, etc.). We'll use Firebase as the backend.
📌 Step 1: Create a Firebase Project
- Go to Firebase → https://console.firebase.google.com/
- Click "Create a Project" and give it a name (e.g.,
BloggerChat
). - Disable Google Analytics (not required) and click Continue.
- Wait for the project to be created, then click Continue.
📌 Step 2: Set Up Firebase Database
- In your Firebase project, go to Build → Realtime Database.
- Click Create Database.
- Choose Start in test mode (this allows anyone to send messages).
- Click Enable.
- Your database is now ready.
📌 Step 3: Get Firebase Config Keys
- In Firebase, go to Project settings (⚙️ icon on the left).
- Scroll down to Your apps and click "Web" (</>).
- Register an app (e.g.,
BloggerChatApp
). - Click Register app, then Continue to console.
- Copy the Firebase SDK Config (it looks like this 👇):
Save this; you'll need it in Step 5.
📌 Step 4: Add Chat Box Code to Blogger
Now, we will create the chat box where users can send messages and upload files.
- Go to Blogger → Layout → Add a Gadget → HTML/JavaScript.
- Paste this full HTML, CSS, and JavaScript code: