Fabric.js is one of the the most powerful JavaScript libraries around — it adds an interactive layer to the classic HTML5 canvas, allowing a simplified implementation of everything from drawing tools to animations.

Recently, I wanted to combine the power of Fabric.js with the power of Socket.IO, a JavaScript framework for realtime communication, to create a canvas that multiple users could interact with together.

I didn’t find much information on this combination, so I decided to document my process for creating a simple collaborative canvas.

I’ll be using React for the front end, and Express for the server, but this code can be adapted to other frameworks.

#javascript

Create a Collaborative Canvas with Fabric.js and Socket.IO
2.65 GEEK