A TypeScript-based client for interacting with the ClickUp API. This library provides an easy-to-use, type-safe interface for managing Workspaces (teams), Spaces, Folders, Lists, and Tasks in ClickUp.
- Fetch Workspaces (teams), Spaces, Folders, Lists, and Tasks from ClickUp
- Retrieve detailed information about specific entities
- Supports TypeScript for strong typing and autocompletion
- Modular design with separate classes for each resource type
- Built with
axiosfor reliable HTTP requests
Install the package via npm:
npm install @hot-gmbh/clickupThis package implements the functionality documented in the ClickUp API documentation and mirrors the routes available in their Postman collection.
import { ClickUp } from "@hot-gmbh/clickup";
const apiKey = process.env.CLICKUP_API_KEY; // Replace with your ClickUp API key
const clickUp = new ClickUp(apiKey);
// Fetch all spaces for a team
const spaces = await clickUp.spaces.getAll("your_team_id");
console.log("Spaces:", spaces);
console.log("First space ID:", spaces[0].id);import { ClickUp } from "@hot-gmbh/clickup";
async function main() {
const clickUp = new ClickUp(process.env.CLICKUP_API_KEY);
// Get all teams (workspaces)
const teams = await clickUp.teams.getAll();
const teamId = teams[0].id;
// Get spaces for a team, including archived ones
const spaces = await clickUp.spaces.getAll(teamId, true);
console.log("Spaces:", spaces);
// Get folders for a space
const spaceId = spaces[0].id;
const folders = await clickUp.folders.getAll(spaceId);
console.log("Folders:", folders);
// Get lists for a folder
const folderId = folders[0]?.id;
if (folderId) {
const lists = await clickUp.lists.getAll(folderId);
console.log("Lists:", lists);
}
// Get folderless lists for a space
const folderlessLists = await clickUp.lists.getFolderless(spaceId);
console.log("Folderless Lists:", folderlessLists);
}
main().catch(console.error);const clickUp = new ClickUp(apiKey: string, baseUrl?: string);apiKey: Your ClickUp personal API token (e.g.,pk__xxxx_...)baseUrl: Optional base URL for the ClickUp API (defaults tohttps://api.clickup.com/api/v2)
Accessed via clickUp.teams
-
getAll(): Promise<Team[]>- Fetches all teams (workspaces) accessible with the API key
- Returns an array of
Teamobjects
Accessed via clickUp.spaces
getAll(teamId: string | number, includeArchived?: boolean): Promise<Space[]>- Fetches all spaces for a given team.
teamId: The ID of the team/workspace.includeArchived: Optional, includes archived spaces iftrue(default:false).- Returns an array of
Spaceobjects.
Accessed via clickUp.folders
getAll(spaceId: string | number): Promise<Folder[]>- Fetches all folders within a space.
spaceId: The ID of the space.- Returns an array of
Folderobjects or an empty array if none exist.
Accessed via clickUp.lists
-
getAll(folderId: string | number): Promise<List[]>- Fetches all lists within a folder. -folderId: The ID of the folder. - Returns an array ofListobjects. -
getFolderless(spaceId: string | number): Promise<List[]>- Fetches all lists directly under a space (not in a folder).
spaceId: The ID of the space.- Returns an array of
Listobjects.
- Clone the repository:
git clone https://github.com/hot-gmbh/clickup.git
cd clickup- Install dependencies:
npm install- Build the project:
npm run buildclickup/
├── src/
│ ├── clickup.ts # Main ClickUp class
│ ├── teams.ts # Teams (Workspaces) operations
│ ├── spaces.ts # Spaces operations
│ ├── folders.ts # Folders operations
│ ├── lists.ts # Lists operations
│ ├── types.ts # Shared TypeScript types
│ └── index.ts # Entry point exporting ClickUp
├── dist/ # Compiled JavaScript output
├── package.json
└── tsconfig.jsonWe welcome contributions! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a Pull Request.
- Follow TypeScript best practices
- Add tests for new features (if a test suite is added)
- Update the README with new methods or changes.
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter bugs or have feature requests, please open an issue on GitHub.
- Built with axios for HTTP requests.
- Inspired by the ClickUp API documentation.