Bebo Events API

Furqan Rydhan
Bebo Developers
Published in
1 min readSep 4, 2016

Bebo.emitEvent(data);

The emitEvent() function allows communication between clients. Data passed through this function will be received by all clients who are in the same room. This should be paired with the onEvent function below.

Note: data passed this way is non-persistent.

The data parameter should pass an object containing key value pairs you would like to pass between all clients.

Bebo.emitEvent({foo: "bar"});

Bebo.onEvent(callback);

The onEvent() function receives communication between clients. Data passed through emitEvent will be received inside this callback.

Bebo.onEvent(function(data){
console.log('data', data);
});
> {foo: "bar"}

--

--