A TypeScript SDK for the Hackless Public API.
- TypeScript-first client
- API key bearer authentication
- Challenge, leaderboard, and profile helpers
- Health check support
- Thin wrapper over the public REST API
- TypeScript
- Fetch API
- Public REST endpoints
- API key auth
npm install hackless-sdk
# or
yarn add hackless-sdk
# or
pnpm add hackless-sdkimport{createHacklessClient}from"hackless-sdk";constclient=createHacklessClient({baseURL: "https://hackless.dev",apiKey: "your-api-key",timeout: 10000,});// Get all challengesconstchallenges=awaitclient.listChallenges();console.log(challenges);// Get a specific challengeconstchallenge=awaitclient.getChallenge("cryptovault");console.log(challenge);// Get the leaderboardconstleaderboard=awaitclient.getLeaderboard();console.log(leaderboard);// Get your own progressconstme=awaitclient.getMyProgress();console.log(me);// Get a public profileconstprofile=awaitclient.getPublicProfile("user_id_here");console.log(profile);// List writeups for a solved challengeconstwriteups=awaitclient.listWriteupsForChallenge("cryptovault");console.log(writeups.challenge);console.log(writeups.writeups);// Submit a flagconstresult=awaitclient.submitFlag("cryptovault","hackless{example_flag}");console.log(result);// Check API healthconsthealth=awaitclient.health();console.log(health);try{constchallenge=awaitclient.getChallenge("cryptovault");console.log(challenge);}catch(error){if(error.status===404){console.log("Challenge not found");}elseif(error.status===401){console.log("Unauthorized");}else{console.log("Error:",error.message);}}// Set authentication tokenclient.setApiKey("your-new-token");// Remove authentication tokenclient.removeApiKey();// Set request timeoutclient.setTimeout(15000);The main client class for interacting with the Hackless public API.
baseURLorbaseUrl(string, optional): API base URL. Default:https://hackless.devapiKey(string, optional): API authentication keytimeout(number, optional): Request timeout in milliseconds. Default:10000headers(object, optional): Additional headers to include in requestsfetchImpl(function, optional): Custom fetch implementation
listChallenges(): Get all public challengesgetChallenge(slug): Get a specific challengesubmitFlag(slug, flag): Submit a flag for a challenge
getLeaderboard(): Get the public leaderboard
getMyProgress(): Get the authenticated user's profile and progressgetPublicProfile(userId): Get a public profile by user ID
listWriteupsForChallenge(slug): Get the writeups visible for a solved challenge
health(): Check API health status
setApiKey(token): Set authentication tokenremoveApiKey(): Remove authentication tokensetTimeout(timeout): Set request timeout
The SDK includes TypeScript types for all API entities:
ChallengeSummaryChallengeDetailLeaderboardEntryPublicProfileMyProfileSubmitFlagResultWriteupListChallengeWriteupListItemWriteupListResponseChallengeDifficultyHacklessClientOptionsHacklessApiError
cd hackless-sdk
pnpm install
pnpm run build
pnpm run checkMIT
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This package is intentionally thin. It mirrors the Hackless public REST API rather than the internal tRPC router.
- hackless
- ctf
- sdk
- api
- mcp
- claude