Developer platform

Live chat, dashboards and multiplayer over WebSockets.

Push updates to every open browser the moment something happens: chat messages, order status, live scores, cursors, notifications. Channels, presence and permissions are built in, the client reconnects by itself, and you pay for messages and connected time with nothing idle to run.

// lyrcloud.json: "realtime": "REALTIME"
export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    // The browser asks for a token after your own sign-in
    if (url.pathname === '/realtime-token') {
      return Response.json(await env.REALTIME.token({
        user: 'ana', channels: ['room-*'], publish: true, presence: true,
      }));
    }
    // Something happened: tell everyone in the room
    await env.REALTIME.publish('room-1', { text: 'Order #42 shipped' });
    return new Response('ok');
  },
};

// <script src="https://www.lyrcloud.com/realtime.js"></script>
// const rt = new LyrRealtime({ auth: () => fetch('/realtime-token').then((r) => r.json()) });
// rt.subscribe('room-1', (data, msg) => console.log(msg.from, data));
⇄ Realtime

What you get

Channels with permissions

Your function gives each browser a signed token naming the channels it may join and publish to, with wildcards like room-*.

Send from anywhere

env.REALTIME.publish() in a function, rt.publish() in the browser, the API, or lyrcloud realtime publish.

Presence

See who is in a channel, and get join and leave events with each user’s name or avatar.

A client that copes

One script tag or lyrcloud/realtime. It reconnects with a fresh token, rejoins its channels and keeps the connection alive.

Scales without servers

Thousands of connections on managed WebSockets, with no sockets server to size, patch or keep warm.

Included in every plan

Launch: 100 connections, 500,000 messages a month. Scale: 5,000 and 10M. Enterprise: 50,000 and 100M. Past that, $1.50 per million messages from Lyrcloud credit.

Works with the rest of Lyrcloud

🌐

Domains

Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.

Learn more
⚑

Global CDN

Response caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.

Learn more
πŸ”’

Application Security

Rate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.

Learn more

Try Realtime free.

Create a free account in under a minute. No credit card required.