Introduction
EmitWave is realtime messaging infrastructure. Subscribe to channels over WebSockets and publish signed events from your server.
What EmitWave is
EmitWave is realtime pub/sub infrastructure. Your frontend connects to a single WebSocket and subscribes to channels; your trusted backend publishes events to those channels; every connected subscriber receives them in milliseconds.
You interact with EmitWave through two things: a signed publish endpoint for your trusted server, and the realtime WebSocket your browser SDK connects to. Everything in between — authorization, channel scoping, and fan-out — is handled for you.
How it works
A typical integration has two sides:
- Browser — the
@emitwave/js(or@emitwave/vue) client connects with your public application key and an end-user token, then subscribes to channels. - Server — a server SDK (
@emitwave/node, Go, PHP, or the Laravel broadcaster) publishes events with an HMAC-signed request to the gateway.
Channel names are automatically scoped to your application after the connection token returns the application ID, so two tenants never share a channel.
Credentials
EmitWave uses separate credentials for browser connections and server publishing. Keep the server secret on the server — it must never appear in a browser bundle.
| Credential | Used by | Purpose |
|---|---|---|
| ew_pk_… | Browser | Public application key — identifies the app, safe to expose |
| End-user Bearer token | Browser | Authenticates the current user to EmitWave |
| Connection token | SDK | Short-lived; minted automatically for every socket connection |
| Subscription token | SDK | Short-lived; authorizes a private or presence channel |
| Server key + secret | Trusted server | HMAC-signs publish requests |
See Authentication for the full flow.
Channel types
| Example | Type | Authorization |
|---|---|---|
| news | Public | Connection token only |
| cache-prices | Public cache | Connection token; replays the latest retained event |
| private-account.42 | Private | Truthy authorization callback |
| presence-room.lobby | Presence | Callback returning { id, info } |
| private-encrypted-account.42 | Private encrypted | Private callback plus a per-channel decryption key |
Read the full reference in Channels.
Where to go next
- Quickstart — subscribe and publish your first event.
- Channels and Presence — the core primitives.
- Publishing — how signed server events reach subscribers.
- API reference — the publish and management endpoints.