Instant WebSockets.
Zero headaches.
A lightning-fast real-time event platform. Get your free API key, integrate in minutes with 4 lines of code, and scale flawlessly.
// npm install emitra-js
const Emitra = require('emitra-js');
// Client A — subscribes and listens for messages
const receiver = new Emitra('YOUR_APP_KEY');
const channel = receiver.subscribe('my-channel');
channel.on('my-event', (data) => {
console.log('✅ Received:', data);
receiver.disconnect();
sender.disconnect();
});
// Client B — sends a message after both clients connect
const sender = new Emitra('YOUR_APP_KEY');
const senderChannel = sender.subscribe('my-channel');
setTimeout(() => {
console.log('📤 Sending message...');
senderChannel.trigger('my-event', { text: 'hello world' });
}, 1500);
Open this HTML file in two browser tabs — type in one tab and see it appear in the other.
<!-- index.html — open in two tabs to see real-time in action -->
<script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
<script src="https://cdn.evnt-flow.com/emitra/v1/emitra.min.js"></script>
<input id="msg" placeholder="Type a message..." />
<button onclick="send()">Send</button>
<ul id="log"></ul>
<script>
const ef = new Emitra('YOUR_APP_KEY');
const channel = ef.subscribe('my-channel');
channel.on('my-event', (data) => {
document.getElementById('log').innerHTML +=
`<li>${data.text}</li>`;
});
function send() {
const text = document.getElementById('msg').value;
channel.trigger('my-event', { text });
}
</script>
// composer require emitra/emitra-php
require 'vendor/autoload.php';
use Emitra\Emitra;
// Client A — subscribes and listens for messages
$receiver = new Emitra('YOUR_APP_KEY', 'my-channel');
// Client B — sends a message
$sender = new Emitra('YOUR_APP_KEY', 'my-channel');
$sender->trigger('my-event', ['text' => 'hello world']);
$sender->disconnect();
Python Client — Coming Soon
We're building a native Python library. In the meantime, you can use our Node.js or TypeScript client.
// npm install emitra-js
import Emitra from 'emitra-js';
const ef = new Emitra('YOUR_APP_KEY');
const channel = ef.subscribe('my-channel');
// Listen for incoming messages from OTHER clients
// Note: sender does NOT receive their own messages
channel.on('my-event', (data: any) => {
console.log('Received:', data);
});
// Send a message — other subscribers will receive it
channel.trigger('my-event', { message: 'hello world' });