Skip to content

Commit 982f51a

Browse files
jottakkaFrancisco Liberaltorresmateo
authored
[PROD-64]Add ClickUp auth provider documentation (#404)
* 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 * Update clickup.mdx * Update clickup.mdx Co-authored-by: Mateo Torres <[email protected]> --------- Co-authored-by: Francisco Liberal <[email protected]> Co-authored-by: Mateo Torres <[email protected]>
1 parent d2cd4bb commit 982f51a

File tree

5 files changed

+225
-0
lines changed

5 files changed

+225
-0
lines changed
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: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
import { Tabs } from "nextra/components";
2+
3+
# ClickUp auth provider
4+
5+
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.
6+
7+
### What's documented here
8+
9+
This page describes how to use and configure ClickUp auth with Arcade.
10+
11+
This auth provider is used by:
12+
13+
- Your [app code](#using-clickup-auth-in-app-code) that needs to call ClickUp APIs
14+
- Or, your [custom tools](#using-clickup-auth-in-custom-tools) that need to call ClickUp APIs
15+
16+
## Configuring ClickUp auth
17+
<Note>
18+
When using your own app credentials, make sure you configure your project to use a [custom user verifier](/home/auth/secure-auth-production#build-a-custom-user-verifier). Without this, your end-users will not be able to use your app or agent in production.
19+
</Note>
20+
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.
21+
22+
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.
23+
24+
Before showing how to configure your ClickUp app credentials, let's go through the steps to create a ClickUp app.
25+
26+
### Create a ClickUp app
27+
28+
- Navigate to your ClickUp workspace and go to **Settings → Apps**
29+
- Click **Create new app** in the OAuth Apps section
30+
- Fill in your app name and description
31+
- Set the OAuth Redirect URL to: `https://cloud.arcade.dev/api/v1/oauth/callback`
32+
- Copy the Client ID and Client Secret, which you'll need below
33+
34+
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).
35+
36+
## Configuring your own ClickUp Auth Provider in Arcade
37+
38+
There are two ways to configure your ClickUp app credentials in Arcade:
39+
40+
1. From the Arcade Dashboard GUI
41+
2. By editing the `engine.yaml` file directly (for a self-hosted Arcade Engine)
42+
43+
We show both options step-by-step below.
44+
45+
<Tabs items={["Dashboard GUI", "Engine Configuration YAML"]}>
46+
<Tabs.Tab>
47+
48+
### Configure ClickUp Auth Using the Arcade Dashboard GUI
49+
50+
<Steps>
51+
52+
#### Access the Arcade Dashboard
53+
54+
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.
55+
56+
#### Navigate to the OAuth Providers page
57+
58+
- Under the **OAuth** section of the Arcade Dashboard left-side menu, click **Providers**.
59+
- Click **Add OAuth Provider** in the top right corner.
60+
- Select the **Included Providers** tab at the top.
61+
- In the **Provider** dropdown, select **ClickUp**.
62+
63+
#### Enter the provider details
64+
65+
- Choose a unique **ID** for your provider (e.g. "my-clickup-provider").
66+
- Optionally enter a **Description**.
67+
- Enter the **Client ID** and **Client Secret** from your ClickUp app.
68+
69+
#### Create the provider
70+
71+
Hit the **Create** button and the provider will be ready to be used in the Arcade Engine.
72+
73+
</Steps>
74+
75+
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.
76+
77+
</Tabs.Tab>
78+
<Tabs.Tab>
79+
80+
### Configuring ClickUp auth in self-hosted Arcade Engine configuration
81+
82+
<Steps>
83+
84+
### Set environment variables
85+
86+
Set the following environment variables:
87+
88+
```bash
89+
export CLICKUP_CLIENT_ID="<your client ID>"
90+
export CLICKUP_CLIENT_SECRET="<your client secret>"
91+
```
92+
93+
Or, you can set these values in a `.env` file:
94+
95+
```bash
96+
CLICKUP_CLIENT_ID="<your client ID>"
97+
CLICKUP_CLIENT_SECRET="<your client secret>"
98+
```
99+
100+
<Tip>
101+
See [Engine configuration](/home/local-deployment/configure/engine) for more information on how
102+
to set environment variables and configure the Arcade Engine.
103+
</Tip>
104+
105+
### Edit the Engine configuration
106+
107+
Edit the `engine.yaml` file and add a `clickup` item to the `auth.providers` section:
108+
109+
```yaml file=<rootDir>/examples/code/integrations/clickup/config_provider.engine.yaml {3-9}
110+
111+
```
112+
113+
</Steps>
114+
115+
</Tabs.Tab>
116+
</Tabs>
117+
118+
## Using ClickUp auth in app code
119+
120+
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.
121+
122+
Use `client.auth.start()` to get a user token for the ClickUp API:
123+
124+
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
125+
<Tabs.Tab>
126+
127+
```python file=<rootDir>/examples/code/integrations/clickup/clickup_custom_auth.py {8-12}
128+
129+
```
130+
131+
</Tabs.Tab>
132+
<Tabs.Tab>
133+
134+
```javascript file=<rootDir>/examples/code/integrations/clickup/clickup_custom_auth.js {8-10}
135+
136+
```
137+
138+
</Tabs.Tab>
139+
</Tabs>
140+
141+
## Using ClickUp auth in custom tools
142+
143+
You can author your own [custom tools](/home/build-tools/create-a-toolkit) that interact with the ClickUp API.
144+
145+
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:
146+
147+
```python file=<rootDir>/examples/code/integrations/clickup/clickup_custom_tool.py {5-6,9-13,20}
148+
149+
```

0 commit comments

Comments
 (0)