/togetherjs

A service for your website that makes it surprisingly easy to collaborate in real-time.

Primary LanguageJavaScriptMozilla Public License 2.0MPL-2.0

TogetherJS + Firebase

TogetherJS is a service for your website that makes it surprisingly easy to collaborate in real-time. Learn more at the original Github repository.

This repository lets you use Firebase as the backend for your TogetherJS sessions.

Try it out!

Benefits

There are two benefits to using Firebase with TogetherJS:

  • Persistence - Sessions are automatically persisted, which allows for easy replay of sessions (cursor movements, chat history, etc) if required. Note this is not enabled by default, see the comment on line 240 in channel.js to enable.

  • Scalability - Firebase is a robust service and is built to automatically scale with your usage.

Usage

Include the modified version of TogetherJS along with Firebase. You may also (optionally) set the HUB URL to your own Firebase:

<script>
  TowTruckConfig_hubBase = "https://<my-firebase>.firebaseio.com/";
</script>
<script src="https://cdn.firebase.com/v0/firebase.js"></script>
<script src="http://firebase.github.io/togetherjs/togetherjs.js"></script>

Then use TogetherJS as you normally would:

<button onclick="TowTruck(this); return false;">Start TowTruck</button>

If you want to build your own version of the JavaScript libraries, don't forget to set HUB_URL to a valid Firebase URL (https://together.firebaseio-demo.com by default) while running grunt. For example:

HUB_URL="https://<your-firebase>.firebaseio.com/" grunt --base-url="/togetherjs" devwatch