Docs
Search docs

Stream repository events

GET/api/repos/{owner}/{repo}/events

streamRepositoryEvents

Streams repository activity as `text/event-stream`. Authentication is optional; anonymous callers can only subscribe to public repositories. Content frames have an `event:` name from `RepoEventType` and a JSON `SseEventResponse` as `data:`; they are invalidation hints, not data. Two control frames carry a `RepoStreamControl`: `hello`, sent once after any replay, means every event on the repository from here on arrives in order or the stream says `resync`; `resync` means the client must refetch what it shows (the reason says why), after which the stream continues live. Frames carry an opaque resume cursor as `id:` (on the last frame of each batch, and on every control frame). To resume, send it back as the `Last-Event-ID` header (the browser does on its own retries) or as `last_event_id` (a new `EventSource`); the header wins. A resume replays what was missed, or answers `resync` when it cannot. While the server's event bus is degraded the stream closes and new connections get 503; resume from the last cursor when it is back.

Authentication optional — this operation also accepts anonymous requests. When authenticating, use a bearer token or a session cookie.

curl

curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/events' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

fetch("https://neosource.dev/api/repos/OWNER/REPO/events", {
  method: "GET",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
  },
});

Path parameters

ownerrequired

Repository owner or organization slug.

string

reporequired

Repository name.

string

Query parameters

last_event_id

Resume cursor: the `id:` of the last frame the client received, for a NEW `EventSource` (which cannot set headers). Opaque, at most 128 characters. The `Last-Event-ID` header, which the browser sends on its own retries, takes precedence when present. An unusable cursor answers `resync` with reason `cursor_invalid`.

string

Responses

200SSE event stream

text/event-stream

string

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 423Locked — one of: busy
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget