Skip to content

Commit 46a6cf5

Browse files
author
Francisco Liberal
committed
Add ClickUp auth provider documentation
- Add comprehensive ClickUp auth provider tutorial at pages/home/auth-providers/clickup.mdx - Follow same structure and style as existing Reddit auth provider documentation - Include step-by-step OAuth app creation instructions for ClickUp - Add both Dashboard GUI and engine.yaml configuration options - Create example files with clickup_ prefix for better organization: - clickup_custom_auth.py: Python OAuth flow example - clickup_custom_auth.js: JavaScript OAuth flow example - clickup_custom_tool.py: Custom tool with real ClickUp API integration - config_provider.engine.yaml: Engine configuration example - Remove scopes from auth examples (ClickUp API doesn't require scopes) - Include real ClickUp API request example using /api/v2/team endpoint - Add proper error handling and response parsing in tool example
1 parent 031a3d9 commit 46a6cf5

5 files changed

Lines changed: 229 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Arcade } from "arcade-js";
2+
3+
const client = new Arcade();
4+
5+
const auth = await client.auth.start({
6+
provider: "clickup",
7+
});
8+
9+
if (auth.status !== "completed") {
10+
console.log("Finish authorization at:", auth.url);
11+
await client.auth.waitForCompletion(auth);
12+
}
13+
14+
const { token } = auth.context;
15+
// Use the token in ClickUp API requests
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from arcadepy import Arcade
2+
3+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
user_id = "{arcade_user_id}"
6+
7+
# Start the authorization process
8+
auth_response = client.auth.start(
9+
user_id=user_id,
10+
provider="clickup",
11+
)
12+
13+
if auth_response.status != "completed":
14+
print("Please complete the authorization challenge in your browser:")
15+
print(auth_response.url)
16+
17+
# Wait for the authorization to complete
18+
auth_response = client.auth.wait_for_completion(auth_response)
19+
20+
token = auth_response.context.token
21+
# TODO: Do something interesting with the token...
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import httpx
2+
from arcade_tdk import tool, ToolContext
3+
from arcade_tdk.auth import ClickUp
4+
5+
@tool(requires_auth=ClickUp())
6+
async def get_my_workspaces(context: ToolContext) -> dict:
7+
"""Get the authenticated user's workspaces (teams) from ClickUp."""
8+
token = context.authorization.token
9+
10+
# Make authenticated request to ClickUp API
11+
async with httpx.AsyncClient() as client:
12+
response = await client.get(
13+
"https://api.clickup.com/api/v2/team",
14+
headers={
15+
"Authorization": token,
16+
"Content-Type": "application/json"
17+
}
18+
)
19+
20+
if response.status_code == 200:
21+
data = response.json()
22+
teams = data.get("teams", [])
23+
return {
24+
"success": True,
25+
"teams": [{"id": team["id"], "name": team["name"]} for team in teams]
26+
}
27+
else:
28+
return {
29+
"success": False,
30+
"error": f"ClickUp API error: {response.status_code} - {response.text}"
31+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
auth:
2+
providers:
3+
- id: default-clickup
4+
description: "The default ClickUp provider"
5+
enabled: true
6+
type: oauth2
7+
provider_id: clickup
8+
client_id: ${env:CLICKUP_CLIENT_ID}
9+
client_secret: ${env:CLICKUP_CLIENT_SECRET}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
import { Tabs } from "nextra/components";
2+
3+
# ClickUp auth provider
4+
5+
<Note>
6+
At this time, Arcade does not offer a default ClickUp Auth Provider. To use
7+
ClickUp auth, you must create a custom Auth Provider with your own ClickUp OAuth
8+
2.0 credentials as described below.
9+
</Note>
10+
11+
The ClickUp auth provider enables tools and agents to call the ClickUp API on behalf of a user. Behind the scenes, the Arcade Engine and the ClickUp auth provider seamlessly manage ClickUp OAuth 2.0 authorization for your users.
12+
13+
### What's documented here
14+
15+
This page describes how to use and configure ClickUp auth with Arcade.
16+
17+
This auth provider is used by:
18+
19+
- Your [app code](#using-clickup-auth-in-app-code) that needs to call ClickUp APIs
20+
- Or, your [custom tools](#using-clickup-auth-in-custom-tools) that need to call ClickUp APIs
21+
22+
## Configuring ClickUp auth
23+
24+
In a production environment, you will most likely want to use your own ClickUp app credentials. This way, your users will see your application's name requesting permission.
25+
26+
You can use your own ClickUp credentials in both the Arcade Cloud and in a [self-hosted Arcade Engine](/home/local-deployment/install/local) instance.
27+
28+
Before showing how to configure your ClickUp app credentials, let's go through the steps to create a ClickUp app.
29+
30+
### Create a ClickUp app
31+
32+
- Navigate to your ClickUp workspace and go to **Settings → Apps**
33+
- Click **Create new app** in the OAuth Apps section
34+
- Fill in your app name and description
35+
- Set the OAuth Redirect URL to: `https://cloud.arcade.dev/api/v1/oauth/callback`
36+
- Copy the Client ID and Client Secret, which you'll need below
37+
38+
Next, add the ClickUp app to your Arcade Engine configuration. You can do this in the Arcade Dashboard, or by editing the `engine.yaml` file directly (for a self-hosted instance).
39+
40+
## Configuring your own ClickUp Auth Provider in Arcade
41+
42+
There are two ways to configure your ClickUp app credentials in Arcade:
43+
44+
1. From the Arcade Dashboard GUI
45+
2. By editing the `engine.yaml` file directly (for a self-hosted Arcade Engine)
46+
47+
We show both options step-by-step below.
48+
49+
<Tabs items={["Dashboard GUI", "Engine Configuration YAML"]}>
50+
<Tabs.Tab>
51+
52+
### Configure ClickUp Auth Using the Arcade Dashboard GUI
53+
54+
<Steps>
55+
56+
#### Access the Arcade Dashboard
57+
58+
To access the Arcade Cloud dashboard, go to [api.arcade.dev/dashboard](https://api.arcade.dev/dashboard). If you are self-hosting, by default the dashboard will be available at `http://localhost:9099/dashboard`. Adjust the host and port number to match your environment.
59+
60+
#### Navigate to the OAuth Providers page
61+
62+
- Under the **OAuth** section of the Arcade Dashboard left-side menu, click **Providers**.
63+
- Click **Add OAuth Provider** in the top right corner.
64+
- Select the **Included Providers** tab at the top.
65+
- In the **Provider** dropdown, select **ClickUp**.
66+
67+
#### Enter the provider details
68+
69+
- Choose a unique **ID** for your provider (e.g. "my-clickup-provider").
70+
- Optionally enter a **Description**.
71+
- Enter the **Client ID** and **Client Secret** from your ClickUp app.
72+
73+
#### Create the provider
74+
75+
Hit the **Create** button and the provider will be ready to be used in the Arcade Engine.
76+
77+
</Steps>
78+
79+
When you use tools that require ClickUp auth using your Arcade account credentials, the Arcade Engine will automatically use this ClickUp OAuth provider. If you have multiple ClickUp providers, see [using multiple auth providers of the same type](/home/auth-providers#using-multiple-providers-of-the-same-type) for more information.
80+
81+
</Tabs.Tab>
82+
<Tabs.Tab>
83+
84+
### Configuring ClickUp auth in self-hosted Arcade Engine configuration
85+
86+
<Steps>
87+
88+
### Set environment variables
89+
90+
Set the following environment variables:
91+
92+
```bash
93+
export CLICKUP_CLIENT_ID="<your client ID>"
94+
export CLICKUP_CLIENT_SECRET="<your client secret>"
95+
```
96+
97+
Or, you can set these values in a `.env` file:
98+
99+
```bash
100+
CLICKUP_CLIENT_ID="<your client ID>"
101+
CLICKUP_CLIENT_SECRET="<your client secret>"
102+
```
103+
104+
<Tip>
105+
See [Engine configuration](/home/local-deployment/configure/engine) for more information on how
106+
to set environment variables and configure the Arcade Engine.
107+
</Tip>
108+
109+
### Edit the Engine configuration
110+
111+
Edit the `engine.yaml` file and add a `clickup` item to the `auth.providers` section:
112+
113+
```yaml file=<rootDir>/examples/code/integrations/clickup/config_provider.engine.yaml {3-9}
114+
115+
```
116+
117+
</Steps>
118+
119+
</Tabs.Tab>
120+
</Tabs>
121+
122+
## Using ClickUp auth in app code
123+
124+
Use the ClickUp auth provider in your own agents and AI apps to get a user-scoped token for the ClickUp API. See [authorizing agents with Arcade](/home/auth/how-arcade-helps) to understand how this works.
125+
126+
Use `client.auth.start()` to get a user token for the ClickUp API:
127+
128+
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
129+
<Tabs.Tab>
130+
131+
```python file=<rootDir>/examples/code/integrations/clickup/clickup_custom_auth.py {8-12}
132+
133+
```
134+
135+
</Tabs.Tab>
136+
<Tabs.Tab>
137+
138+
```javascript file=<rootDir>/examples/code/integrations/clickup/clickup_custom_auth.js {8-10}
139+
140+
```
141+
142+
</Tabs.Tab>
143+
</Tabs>
144+
145+
## Using ClickUp auth in custom tools
146+
147+
You can author your own [custom tools](/home/build-tools/create-a-toolkit) that interact with the ClickUp API.
148+
149+
Use the `ClickUp()` auth class to specify that a tool requires authorization with ClickUp. The `context.authorization.token` field will be automatically populated with the user's ClickUp token:
150+
151+
```python file=<rootDir>/examples/code/integrations/clickup/clickup_custom_tool.py {5-6,9-13,20}
152+
153+
```

0 commit comments

Comments
 (0)