@teamtv/eventstream-client

Client to the teamtv match realtime eventstream API

Usage no npm install needed!

<script type="module">
  import teamtvEventstreamClient from 'https://cdn.skypack.dev/@teamtv/eventstream-client';
</script>

README

EventStream Client

Simple Client for the teamtv event stream API

Installation

npm install --save @teamtv/eventstream-client

Usage

import { EventStream, SSEEventStreamSource } from '@teamtv/eventstream-client';

const es = new EventStream(
  new SSEEventStreamSource("<teamtv eventstream endpoint>")
);

es.on("shot", (attributes) => {
  if (attributes.result === "GOAL") {
    console.log("Shot", attributes);
  }
});