Static
versionThe Parkrun.JS version.
Package version.
Static
licenseThe Parkrun.JS license, as stated by NPM.
License type.
Static
authAsynchronously authenticate a user via id/password
ParkrunAuthError (Unexpected) error during authentication flow.
ParkrunUserPassError Error thrown when the username or password is incorrect.
const Parkrun = require("parkrun.js")
const client = await Parkrun.authSync("A1234567", "password")
Static
authSynchronously authenticate a user via id/password
ParkrunAuthError (Unexpected) error during authentication flow.
ParkrunUserPassError Error thrown when the username or password is incorrect.
const Parkrun = require("parkrun.js")
Parkrun.auth("A1234567", "password", function(client, err) {
if (!err) {
// no errors, continue
}
})
// Alternative example using ES6
const Parkrun = require("parkrun.js")
Parkrun.auth("A1234567", "password", (client, err) => {
if (!err) {
// no errors, continue
}
})
the callback to run once login has completed. The first paramater is the Parkrun client.
Static
recreateRecreate a client based on previous authentication details.
Please note that no authentication checks are handled here.
authRefresh instead for an actual authentication method.
This method was meant for legacy users, and has a better alternative available. However, it will be included for the forseeable future.
Static
auth(Asynchronously) Authenticate a client based on a previous refresh token.
ParkrunAuthError Error thrown if the refresh token is invalid.
ParkrunRefreshExpiredError Error thrown if the refresh token has expired.
Error General authentication flow error.
Asynchronously get an athlete based on their ID.
User object of the specified athlete.
ParkrunNetError ParkrunJS Networking Error.
ParkrunValidationError ParkrunJS Validation Error - API response was not what was expected.
athlete id of the user you wish to get.
Get all news posts for the specified event id.
Array of news posts.
ParkrunNetError ParkrunJS Networking Error.
Get the Profile of the currently logged-in user.
Your ClientUser object.
ParkrunNetError ParkrunJS Networking Error.
ParkrunValidationError ParkrunJS Validation Error - API response was not what was expected.
Asynchronously get an event based on its ID.
Event Object.
ParkrunNetError ParkrunJS Networking Error.
Get statistics across all of parkrun.
Raw statistics object.
ParkrunNetError ParkrunJS Networking Error.
Get an array with the names of all parkrun events, in alphabetical order.
ParkrunNetError ParkrunJS Networking Error.
Get an array with the names of all parkrun events in the specified country, in alphabetical order.
ParkrunNetError ParkrunJS Networking Error.
Country ID.
Get an array of Event objects for each parkrun that the specified athlete has run, in alphabetical order.
(Needed for freedomRuns)
ParkrunNetError ParkrunJS Networking Error.
The athlete ID for which to get results for.
Optional
url?: stringOptional
params?: { expandedDetails: boolean; athleteID?: number }Optional
athleteID?: numberGenerated using TypeDoc
The main hub for interacting with the Parkrun API.