Skip to content

Commit 0b86d3d

Browse files
committed
Document the Connect component API
* Add new left-nav link to the new docs * Describe how to use the new API to configure and run a component * Document the new API endpoints in the API/SDK reference section * Add the exact `pnpm` entry to `.tool-versions` in the docs directory
1 parent ba845b1 commit 0b86d3d

File tree

4 files changed

+399
-10
lines changed

4 files changed

+399
-10
lines changed

docs-v2/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
nodejs 20.9.0
2+
pnpm 9.14.2

docs-v2/pages/connect/_meta.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export default {
99
"title": "Quickstart",
1010
},
1111
"workflows": {
12-
"title": "Running workflows",
12+
"title": "Running Workflows",
13+
},
14+
"components": {
15+
"title": "Running Components",
1316
},
1417
"api": {
1518
"title": "API & SDK Reference",

docs-v2/pages/connect/api.mdx

Lines changed: 128 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ https://api.pipedream.com/v1/connect/{project_id}
1515

1616
## Installing the TypeScript SDK
1717

18-
Pipedream's SDK will work in any browser or server that can run JavaScript.
18+
Pipedream's SDK will work in any browser or server that can run JavaScript.
1919

2020
### npm
2121

@@ -76,7 +76,7 @@ Here's a Next.js example [from our quickstart](/connect/quickstart):
7676
import { createFrontendClient } from "@pipedream/sdk/browser"
7777
// Example from our Next.js app
7878
import { serverConnectTokenCreate } from "./server"
79-
79+
8080
const { token, expires_at } = await serverConnectTokenCreate({
8181
external_user_id: externalUserId // The end user's ID in your system
8282
});
@@ -134,7 +134,7 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/tokens \
134134

135135
## External users
136136

137-
When you use the Connect API, you'll pass an `external_user_id` parameter when initiating account connections and retrieving credentials. This is your user's ID, in your system — whatever you use to uniquely identify them.
137+
When you use the Connect API, you'll pass an `external_user_id` parameter when initiating account connections and retrieving credentials. This is your user's ID, in your system — whatever you use to uniquely identify them.
138138

139139
Pipedream associates this ID with user accounts, so you can retrieve credentials for a specific user, and invoke workflows on their behalf.
140140

@@ -165,7 +165,7 @@ See [the Connect tokens docs](/connect/tokens) for more information.
165165

166166
```
167167
POST /{project_id}/tokens
168-
```
168+
```
169169

170170
##### Path parameters
171171

@@ -199,7 +199,7 @@ Pipedream will send events on successful auth, or any errors, to this URL via we
199199

200200
##### Examples
201201

202-
To create a short-lived token via TypeScript / JavaScript SDK, you'll need to create a Pipedream API client and call the `createConnectToken` method. In our example app, this code is in `app/server.ts`.
202+
To create a short-lived token via TypeScript / JavaScript SDK, you'll need to create a Pipedream API client and call the `createConnectToken` method. In our example app, this code is in `app/server.ts`.
203203

204204
In other languages, you'll need to make an HTTP POST request to the `/tokens` endpoint to create a token, then return the token to your frontend. Click into other tabs to see examples in additional languages.
205205

@@ -208,8 +208,8 @@ In other languages, you'll need to make an HTTP POST request to the `/tokens` en
208208
```typescript
209209
import {
210210
createBackendClient,
211-
type ConnectAPIResponse,
212-
type ConnectTokenCreateOpts,
211+
type ConnectAPIResponse,
212+
type ConnectTokenCreateOpts,
213213
type ConnectTokenResponse,
214214
} from "@pipedream/sdk/server";
215215

@@ -494,7 +494,7 @@ const account = await pd.getAccountById(accountId, {
494494
include_credentials: true, // set to true to include credentials
495495
});
496496

497-
// Parse and return the data you need. These may contain credentials,
497+
// Parse and return the data you need. These may contain credentials,
498498
// which you should never return to the client
499499
```
500500
</Tabs.Tab>
@@ -517,7 +517,7 @@ const account = await pd.getAccountById(accountId, {
517517
include_credentials: true, // set to true to include credentials
518518
});
519519

520-
// Parse and return the data you need. These may contain credentials,
520+
// Parse and return the data you need. These may contain credentials,
521521
// which you should never return to the client
522522
```
523523
</Tabs.Tab>
@@ -850,6 +850,125 @@ curl -X DELETE "https://api.pipedream.com/v1/connect/{project_id}/users/{externa
850850

851851
Pipedream returns a `204 No Content` response on successful account deletion
852852

853+
854+
### Components
855+
856+
#### List Components
857+
858+
List all the components in the Pipedream registry.
859+
860+
```
861+
GET /{component_type}
862+
```
863+
864+
##### Path parameters
865+
866+
`component_type` **string**
867+
868+
Either `sources`, `actions`, or `components`.
869+
870+
##### Query parameters
871+
872+
`app` **string** (_optional_)
873+
874+
The ID or name slug the app you'd like to retrieve. For example, Slack's unique
875+
app ID is `app_OkrhR1`, and its name slug is `slack`.
876+
877+
You can find the app's ID in the response from the [List apps](#list-apps)
878+
endpoint, and the name slug under the **Authentication** section of any [app
879+
page](https://pipedream.com/apps).
880+
881+
---
882+
883+
`q` **string** (_optional_)
884+
885+
A search query to filter the components by key (see the [component structure
886+
table](/components/api#component-structure)).
887+
888+
#### Retrieve a Component
889+
890+
Retrieve a specific component from the Pipedream registry.
891+
892+
```
893+
GET /{component_type}/{component_key[@component_version]}
894+
```
895+
896+
##### Path parameters
897+
898+
`component_type` **string**
899+
900+
Either `sources`, `actions`, or `components`.
901+
902+
---
903+
904+
`component_key` **string**
905+
906+
The key that identifies the component (see the [component structure
907+
table](/components/api#component-structure)).
908+
909+
---
910+
911+
`component_version` **string** (optional)
912+
913+
The version of the component you'd like to retrieve, in SemVer format. If
914+
omitted, the API will return the latest published version.
915+
916+
#### Configure a Component
917+
918+
Configure the next component's prop, based on the current component's
919+
configuration`.
920+
921+
```
922+
GET /{component_type}/configure
923+
```
924+
925+
##### Body Parameters
926+
927+
`configured_props` **object**
928+
929+
A map of the component's props that have already been configured. The keys are
930+
the prop names, and the values correspond to the ones already configured.
931+
932+
---
933+
934+
`external_user_id` **string**
935+
936+
The ID of your end user. Use whatever ID uniquely identifies the user in your
937+
system.
938+
939+
---
940+
941+
`id` **string**
942+
943+
The key that identifies the component (see the [component structure
944+
table](/components/api#component-structure)).
945+
946+
---
947+
948+
`prop_name` **string**
949+
950+
The name of the component's prop you'd like to configure.
951+
952+
###### Example
953+
954+
```json
955+
{
956+
"configured_props": {
957+
"gitlab": {
958+
"authProvisionId": "apn_7rh6LZ4"
959+
},
960+
"projectId": 21208123
961+
},
962+
"external_user_id": "demo-f10b59c6-1331-475e-8acf-6cdb7f572ff9",
963+
"id": "gitlab-list-commits",
964+
"prop_name": "refName"
965+
}
966+
```
967+
968+
#### Invoke an Action
969+
970+
#### Deploy a Trigger
971+
853972
### Projects
854973

855974
#### Retrieve project info

0 commit comments

Comments
 (0)