Node and Phoenix Channels

I’ve been working with a Raspi lately and needed to connect it to my Phoenix app. After talking with chrismccord he showed me it was easier than I thought. See below.

Things you’ll need:

Once you have everything above you can just throw it in your node app just like so:

import {Socket} from "./phoenix.js"
var socket = new Socket("ws://", {transport: require('websocket').w3cwebsocket})

let channel ="raspis:lobby");

  .receive("ok", resp => {
  .receive("error", reason => console.log(`Error joining channel: ${reason}`))

To see how to use the Phoenix.JS library head over to

That’s about it. Simple right?

This project is maintained by meatherly