HabiticaAPIManager

This class manages the calls to the Habitica API and converts the responses into helpful class types.

new HabiticaAPIManager(xclient: string, language: string)
Parameters
xclient (string) The xclient header string for this application. See xclient
language (string = "en") The language code to retrieve content for. See language
Instance Members
language
xclient
content
fetchContentData()
fetchUser(userID)
fetchAuthenticatedUser(userID, userAPIToken)
fetchUserTasks(userID, userAPIToken)
fetchUserWithTasks(userID, userAPIToken)
authGetRequest(baseURL, userID, userAPIToken, queryParams)
getRequest(baseURL, queryParams)
postRequest(baseURL, userID, userAPIToken, queryParams)
replaceKeysWithContent(data)
getQueryStringURL(baseURL, queryParams)

HabiticaUserID

The User's ID. See https://habitica.fandom.com/wiki/APIOptions#User_ID.28UID.29

HabiticaUserID

Type: string

HabiticaAPIToken

The User's API Token. See https://habitica.fandom.com/wiki/API_Options#API_Token

HabiticaAPIToken

Type: string

HabiticaUser

A class representing the Habitica User.

new HabiticaUser(data: object)
Parameters
data (object) the json data object returned from the habitica API.
Instance Members
gems
hourglasses
gold
goldCompact
level
displayName
className
bio
experience
experienceToLevel
mana
manaMax
health
healthMax
stealth
armor
costume
outfit
isSleeping
constitutionBonus
quest
isOnQuest
isOnBossQuest
tasks

HabiticaUserTasksManager

A class representing the list of tasks for a HabiticaUser.

new HabiticaUserTasksManager(data: Array<object>)
Parameters
data (Array<object>) the list of tasks returned from the api call
Instance Members
apiData
taskList
todosDueToday
todosDueOnDate(dueDate)
calculateDailyStatsFor(user)

DailyStats

DailyStats

Type: object

Properties
dueCount (Number) : Count of unfinished dailes that are due today.
totalDamageToSelf (Number) : Total damage user will receive from missed dailies and boss damage.
dailyDamageToSelf (Number) : Damage user will receive from missed dailies.
bossDamage (Number) : Damage entire party will receive from boss due to missed dailies.
dailiesEvaded (Number) : Number of unfinished dailes ignored due to Rogue sneakiness.