/boxrec-requests

make API requests to BoxRec using NodeJS and returns the HTML body

Primary LanguageTypeScript

BoxRec Requests

npm version Known Vulnerabilities Codacy Badge

This project makes HTTP requests to BoxRec and returns the HTML body.
The main purpose of this project is for other projects to easily make requests and return the HTML.

Installation

yarn add -D boxrec-requests or npm install -D boxrec-requests

Setup

import {BoxrecRequests} from "boxrec-requests";

or

const BoxrecRequests = require("boxrec-requests").BoxrecRequests;

Usage

All responses are promises. It is highly suggested that you log into BoxRec before hand like this

const cookieJar = await BoxrecRequests.login(BOXREC_USERNAME, BOXREC_PASSWORD); // returns a cookieJar (your log in cookie)
await BoxrecRequests.getPersonById(cookieJar, 352); // makes next request as a logged in user

BoxRec returns additional data if you're logged in. It's recommended that you log in.
Store the cookie so you can reuse it to lower the amount of log in requests that you make to BoxRec

Todo

Needs proper CI/CD with E2E tests and not mocks