Unofficial TryHackMe Node.js/TypeScript library.
npm i --save-dev thm-api
import { API, countryEnum } from 'thm-api'
const api = new API()
api.getLeaderboard('0day', 'US', (rank: number) => {
console.log(rank)
})
• new ThmApi()
• get
countryList(): Object
Returns an object with country code/name pairs.
readonly
memberof
ThmApi
Object
▸ checkIfUsernameExists(username
, callback
): void
Checks for existence of an user.
Name | Type | Description |
---|---|---|
username |
string |
TryHackMe username |
callback |
Function |
Data callback function |
void
▸ getLeaderboard(username
, countryCode
, callback
): void
Gets rank for an user in a country if provided.
Name | Type | Description |
---|---|---|
username |
string |
TryHackMe username |
countryCode |
string |
Country code |
callback |
Function |
Data callback function |
void
▸ getNewRooms(callback
): void
Get a list with the newest released TryHackMe rooms.
Name | Type | Description |
---|---|---|
callback |
Function |
Data callback function |
void
▸ getRoomDetails(roomName
, callback
): void
Get room details.
Name | Type | Description |
---|---|---|
roomName |
string |
TryHackMe roomname |
callback |
Function |
Data callback function |
void
▸ getRoomVotes(roomName
, callback
): void
Get votes for a given room name.
Name | Type | Description |
---|---|---|
roomName |
string |
TryHackMe roomname |
callback |
Function |
Data callback function |
void
▸ getSeries(callback
): void
Get learning paths.
Name | Type | Description |
---|---|---|
callback |
Function |
Data callback function |
void
▸ searchUsername(username
, callback
): void
Searches for similar usernames. Used to invite users in the platform.
Name | Type | Description |
---|---|---|
username |
string |
TryHackMe username |
callback |
Function |
Data callback function |
void