https://github.com/FirebaseExtended/firechat
Real-time Chat powered by Firebase
https://github.com/FirebaseExtended/firechat
Last synced: about 1 year ago
JSON representation
Real-time Chat powered by Firebase
- Host: GitHub
- URL: https://github.com/FirebaseExtended/firechat
- Owner: FirebaseExtended
- License: mit
- Archived: true
- Created: 2013-05-14T19:06:10.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T13:57:58.000Z (over 5 years ago)
- Last Synced: 2025-03-31T00:07:45.121Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://firechat.firebaseapp.com
- Size: 673 KB
- Stars: 2,414
- Watchers: 198
- Forks: 1,036
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
- License: LICENSE
Awesome Lists containing this project
README
# Firechat [](http://badge.fury.io/gh/firebase%2Ffirechat)
Firechat is a simple, extensible chat widget powered by
[Firebase](https://firebase.google.com/?utm_source=firechat). It is intended to serve as a concise,
documented foundation for chat products built on Firebase. It works out of the box, and is easily
extended.
## Status

This sample is no longer actively maintained and is left here for reference only.
## Live Demo
Visit [firechat.firebaseapp.com](https://firechat.firebaseapp.com/) to see a live demo of Firechat.
[](https://firechat.firebaseapp.com/)
## Setup
Firechat uses the [Firebase Realtime Database](https://firebase.google.com/docs/database/?utm_source=firechat)
as a backend, so it requires no server-side code. It can be added to any web app by including a few
JavaScript files:
```HTML
```
giving your users a way to authenticate:
```HTML
function login() {
// Log the user in via Twitter
var provider = new firebase.auth.TwitterAuthProvider();
firebase.auth().signInWithPopup(provider).catch(function(error) {
console.log("Error authenticating user:", error);
});
}
firebase.auth().onAuthStateChanged(function(user) {
// Once authenticated, instantiate Firechat with the logged in user
if (user) {
initChat(user);
}
});
Login with Twitter
```
and initializing the chat:
```HTML
function initChat(user) {
// Get a Firebase Database ref
var chatRef = firebase.database().ref("chat");
// Create a Firechat instance
var chat = new FirechatUI(chatRef, document.getElementById("firechat-wrapper"));
// Set the Firechat user
chat.setUser(user.uid, user.displayName);
}
```
For detailed integration instructions, see the [Firechat documentation](https://firechat.firebaseapp.com/docs/).
## Getting Started with Firebase
Firechat requires Firebase in order to authenticate users and store data. You can
[sign up here](https://console.firebase.google.com/?utm_source=firechat) for a free account.
## Getting Help
If you have a question about Firechat, feel free to reach out through one of our
[official support channels](https://firebase.google.com/support/?utm_source=firechat).