0.0.4 • Published 5 months ago

cs-sportsbook-client v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

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.

eventIds 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();
0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago