1.1.0-e • Published 9 months ago

@cardtunic/clickup v1.1.0-e

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

ClickUp API SDK

A simple TypeScript SDK for interacting with the ClickUp API.

Installation

npm install @cardtunic/clickup

Usage

import clickup from "@cardtunic/clickup";

const clickupClient = clickup.createClient(process.env.CLICKUP_TOKEN);

const createdTask = await clickupClient.tasks.create("list-id", {
  name: "My Task",
  description: "This is my task",
  due_date: "2023-01-01",
  custom_fields: [
    {
      id: "custom-field-id",
      value: "custom-field-value",
    },
  ],
});

console.log(`Task created with id: ${createdTask.id}`);

Authentication

To use the ClickUp API, you need to authenticate with your OAuth2 token. You can get it by running the following command:

npm clickup-cli login

This command will generate a URL, that you can login and get a code, paste it, and your access token will be saved in your .env file.

Generating config files

To make your life easier, you can use the clickup-cli config to generate a config.clickup.ts at the root of your project, with the workspace, spaces, folders, lists and custom fields, to quick access them, like this:

import clickupConfig from "./config.clickup.ts";

const createdTask = await clickupClient.tasks.create(
  clickupConfig.workspace.spaces.fun_space.lists.my_list.id,
  {
    name: "My Task",
    description: "This is my task",
    due_date: "2023-01-01",
    custom_fields: [
      {
        id: clickupConfig.workspace.custom_fields.cool_custom_field.id,
        value: "custom-field-value",
      },
    ],
  }
);

Just run the command bellow:

npm clickup-cli config
1.0.2

1 year ago

1.1.0

9 months ago

1.0.9-a

1 year ago

1.1.0-e

9 months ago

1.0.9

1 year ago

1.1.0-d

9 months ago

1.0.8

1 year ago

1.1.0-c

9 months ago

1.0.7

1 year ago

1.1.0-b

9 months ago

1.0.6

1 year ago

1.1.0-a

9 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.91

1 year ago

1.0.95

1 year ago

1.0.94

1 year ago

1.0.93

1 year ago

1.0.92

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago