1.1.0-e • Published 1 year ago

@cardtunic/clickup v1.1.0-e

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

2 years ago

1.1.0

1 year ago

1.0.9-a

2 years ago

1.1.0-e

1 year ago

1.0.9

2 years ago

1.1.0-d

1 year ago

1.0.8

2 years ago

1.1.0-c

1 year ago

1.0.7

2 years ago

1.1.0-b

1 year ago

1.0.6

2 years ago

1.1.0-a

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.91

2 years ago

1.0.95

2 years ago

1.0.94

2 years ago

1.0.93

2 years ago

1.0.92

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago