Getting Started
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js (v18 or later)
- A package manager: npm (comes with Node.js), yarn, pnpm, or bun
- A code editor (we recommend VS Code)
- HackHub - Ultimate Hacker Simulator on Steam
Create a New Mod
The fastest way to start is the CLI scaffolding tool:
bash
npm create hackhub-modThis sets up a complete mod project with TypeScript, build config, and templates.
Manual Setup
If you prefer to set things up yourself:
bash
npm install @hotbunny/hackhub-content-sdk --save-devProject Structure
A typical mod project looks like this:
my-mod/
├── src/
│ └── index.ts # Mod entry point
├── dist/ # Build output
├── manifest.json # Mod metadata
├── esbuild.config.ts # Build configuration
├── package.json
└── tsconfig.jsonMod Entry Point
Every mod needs a Bootstrap class decorated with @RegisterModPackage:
typescript
import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";
@RegisterModPackage
export default class MyMod extends Bootstrap {
OnModPackageLoaded() {
console.log("Mod loaded!");
}
OnModPackageUnloaded() {
console.log("Mod unloaded");
}
}Lifecycle Hooks
| Hook | When it's called |
|---|---|
OnModPackageLoaded() | After the mod and all its content are loaded |
OnModPackageUnloaded() | When the mod is disabled or unloaded |
Manifest
Every mod requires a manifest.json in its root directory. See the Manifest Reference for the full schema.
json
{
"id": "my-first-mod",
"name": "My First Mod",
"version": "1.0.0",
"author": "Your Name",
"description": "My first HackHub mod",
"apiVersion": 1,
"permissions": ["events"]
}Building
Run the build command to compile your mod:
bash
npm run buildThis produces a dist/ folder containing mod.js and your assets. The game loads mods from the mods/ folder in the game directory.
