Skip to content

fix(examples): point 06-sse at a live public SSE endpoint - #124

Open
donbagger wants to merge 1 commit into
productdevbook:mainfrom
donbagger:fix/examples-live-sse-endpoint
Open

donbagger wants to merge 1 commit into
productdevbook:mainfrom
donbagger:fix/examples-live-sse-endpoint

Conversation

@donbagger

Copy link
Copy Markdown

The example's own comment says "httpbin doesn't host an SSE endpoint, so this uses sse.dev which echoes a message every 2s", but sse.dev no longer resolves (NXDOMAIN), so the example dies on the initial GET. This swaps in DexPaprika's free, keyless price stream and filters on the named token_price event, which also exercises the SseEvent.event field properly; the manual AbortController became AbortSignal.timeout per the runtime-baseline rule in AGENTS.md. Verified live with pnpm dlx tsx examples/06-sse.ts (plus pnpm lint, pnpm typecheck, and the full vitest suite, 932 passing), first event off the wire:

event: token_price
data: {"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","chain":"ethereum","price":"1840.545532633754","timestamp":1784283722,...}

Disclosure: I do DevRel for DexPaprika. The endpoint is public, no key or signup needed.

sse.dev no longer resolves (NXDOMAIN), so examples/06-sse.ts fails on
the initial GET. Swap it for DexPaprika's free keyless price stream,
which emits named token_price events, and filter on the event name to
show sseStream's named-event handling. AbortSignal.timeout replaces the
manual AbortController per the runtime-baseline rule in AGENTS.md.
@donbagger

Copy link
Copy Markdown
Author

Small one from July. sse.dev is gone at the DNS level, NXDOMAIN today, so examples/06-sse.ts cannot run for anyone who copies it out of the repo.

The patch swaps it for a public keyless SSE stream and skips the keepalive events so the example still exits after three messages. I checked the replacement endpoint again today and it is still emitting events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant