Notifications from your backend
Fill in the form and this site's backend publishes it with one HTTP request. Every window with this room open receives it.
Equivalent curl command
How it works
The browser listens on a public channel. Public channels need no signature: anyone who knows the name can subscribe, so use hard-to-guess names such as a per-user token for anything personal.
Publishing is an HTTP POST to /{channel}/{event} with the app id and secret as basic auth.
The response says how many connected clients received it. Because the secret is required, only your
backend can publish.
const channel = pikoman.listen(`notify-${userToken}`);
channel.on("notification", ({ kind, title, message }) => {
showToast(kind, title, message);
});