sbtech-sports-data-api-client
v2.16.1
Published
```js import { SportsDataApiClient, TimeRange } from 'sbtech-sports-data-api-client'
Downloads
137
Readme
Usage
import { SportsDataApiClient, TimeRange } from 'sbtech-sports-data-api-client'
let config = { sportsApiUrl: 'https://stgapi.sbtech.com/whltemplate/sportsdata/v2' }
let client = new SportsDataApiClient(config)
let query = { query: "$filter=isLive eq true",
locale: "en",
params: { from: '',
timeRange: TimeRange.OneDay,
includeMarkets: "$filter=sportId eq '1'",
initialData: 'true' }}
client.events.pull(query).then((response) => console.log(JSON.stringify(response.data)))
let subscription = client.events.subscribe(query, (r) => console.log(JSON.stringify(r.data.add)),
(e) => console.log(e))
subscription.unsubscribe()