cs-sportsbook-client
v0.0.4
Published
Typescript client to query Caesars data
Downloads
2
Readme
CSSportsbookClient
CSSportsbookClient is a Typescript client for accessing Caesars API. Currently the client supports the data used for Caesars' NFL homepage and pages for individual NFL games.
Setup
Clone the repository and run npm install
.
When making changes to the project, recompile it with tsc
, and run unit tests with npm run test
.
Usage
NFL Homepage data
Instantiate the NFLHome
class with an eventGroupId
and call async doRequest()
. The data gathered from the request will then be available as instance properties of the NFLHome
object.
import { NFL_ID } from "./util/Constants";
const homeRequest = new NFLHome({id: NFL_ID});
await homeRequest.doRequest();
NFL Game data
Instantiate the NFLGame
class with an eventId
and optionally an Event
object to include as an instance property, then call async doRequest()
. The data gathered from the request will then be available as instance properties of the NFLGame
object.
eventId
s can be gathered programatically by iterating over the events found by NFLHome
, or you can target a specific eventId
if you know it in advance.
const gameRequest = new NFLGame({id: '0123456789abcdef'});
await gameRequest.doRequest();