# Live click feed for one link (SSE)

EAS-83: a Server-Sent Events stream of new clicks on this link as they're recorded. Layered on top of the existing ~500ms click-batch pipeline (never a separate capture path): the connection emits `data: <Click>` for each click as its batch is durably persisted (bot clicks excluded, same as recentClicks), one JSON object per click, plus an opening `: open` comment as soon as the stream is accepted and `: ping` heartbeat comments roughly every 10s. One-way and stateless — any replica can serve any client. Same readable scope as GET /v1/links/{id}: the owner, or anyone in the organization when the link's visibility is "org". EAS-83 follow-up: each Click also carries `clicksUsed`/`qrScansUsed` — the same live Redis usage-cap counts GET /v1/links/{id} returns at the top level — so a client can track the Click/QR-scan-limit stats live instead of only refreshing them on the next full reload. Both are omitted if the usage limiter isn't wired server-side (same best-effort degrade as GET's own clicksUsed/qrScansUsed). Open streams are capped per link on each replica, and per user across the whole service (the per-user count is shared through Redis; if Redis is briefly unavailable that cap is not enforced and each replica falls back to its own count). A slot is freed when the stream closes, or within about a minute if the close could not be recorded. Past a cap the response is 429 with a plain-language message and the client retries on its own. The server ends the stream when the caller's access token expires, so a client reconnects (refreshing its token) and refetches — clicks in the gap are not replayed. Every couple of minutes the server also re-checks that the caller still has access (their identity has not changed, and the link still exists and is readable by them) and ends the stream if not.

Canonical: https://easerix.com/docs/developers/api/links/analytics/streamLinkClicks

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

export default function Layout(props) {
  const { APIPage, OpenAPIPage } = props.components ?? {};
  // "APIPage" is the old name from v10, this allows both for backward compatibility
  const Comp = OpenAPIPage ?? APIPage;
  return (
    <>
      {props.children}
      <Comp document="links" operations={[{"path":"/v1/links/{id}/stream","method":"get"}]} />
    </>
  );
}
