StreamJar API

As well as our standard API, we also utilise socket.io to power features such as live donation retrieval, and our overlay. Socket.io is a wrapper for websockets, which allows for fast and simple bidirectional communication between StreamJar and our users. You can incorporate this into your own applications. If you are using Node.js, you can use the socket.io-client module to connect.

Authentication

The easiest way of authenticating is by sending the user's API key. A user's API key is available from the "Settings" section of the StreamJar website.

var sock = io.connect('https://ws.streamjar.tv/', { query: 'key=0IkUg2sAziII3Cr9t1uYHcpL7mcqzveb' });
sock.on('connect', function() {
	console.log('Connected');
});

That's it! Your client will start receiving events. Here's a quick example for listening to events:

sock.on('donation', function(donation) {
	console.log(donation.name + ' just donated to the stream.');
});

All the events you can send and receive are listed below. Please contact us if you have any questions.

Receiving events

Event: "donation"

{
	"name": "Name",
	"email": "[email protected]",
	"message": "Test message.",
	"amount": 10.5,
	"currency": "USD",
	"avatar": "https://www.gravatar.com/avatar/1a2da10e7089f99efa73e1985bf6b9a3?s=128&d=identicon&r=PG",
	"created_at": "2015-08-27T10:12:06.086Z",
	"fields": {}
}

Event: "follow"

{
	"name": "Ethan_",
	"avatar": "https://mixer.com/_latest/img/media/profile.jpg"
}

Event: "subscribe"

{
	"name": "Ethan_",
	"avatar": "https://mixer.com/_latest/img/media/profile.jpg"
}