From c79c48fdef52dd831805a74cc949169c1dcb414a Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 31 Jan 2025 11:27:24 -0800 Subject: [PATCH 01/20] first commit [draft] --- docs-v2/next.config.mjs | 2 +- docs-v2/pages/connect/_meta.tsx | 3 + docs-v2/pages/connect/api-proxy.mdx | 200 ++++++++++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 docs-v2/pages/connect/api-proxy.mdx diff --git a/docs-v2/next.config.mjs b/docs-v2/next.config.mjs index 99c7af289d5ba..06480a838ab3a 100644 --- a/docs-v2/next.config.mjs +++ b/docs-v2/next.config.mjs @@ -50,7 +50,7 @@ export default withNextra({ TMP_SIZE_LIMIT: "2GB", DELAY_MIN_MAX_TIME: "You can pause your workflow for as little as one millisecond, or as long as one year", - PUBLIC_APPS: "2,400", + PUBLIC_APPS: "2,500", REGISTRY_ACTIONS: "5,300", REGISTRY_SOURCES: "2,500", REGISTRY_COMPONENTS: "8,000", diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index 1ba883bb056b5..153f34fc99729 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -17,6 +17,9 @@ export default { "api": { "title": "API & SDK reference", }, + "api-proxy": { + "title": "API proxy", + }, "tokens": { "title": "Connect tokens", }, diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx new file mode 100644 index 0000000000000..4021ece23bb9b --- /dev/null +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -0,0 +1,200 @@ +import { Tabs } from 'nextra/components' +import Callout from '@/components/Callout' + +# Connect Proxy + +Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful for a few scenarios: + +1. You need code-level control and you want to use [Pipedream's OAuth](/connect/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/oauth-clients#using-your-own-oauth-client) +2. There isn't a [pre-built action](/connect/components) for the app, or you need to modify the request + +## Overview + +The Connect proxy enables you to interface with any integrated API and make authenticated requests on behalf of your users, without dealing with OAuth or storing end user credentials. + +- You send a request to the proxy and identify the end user you want to act on behalf of +- The proxy then makes the request to the downstream API and injects your end user's auth credentials +- The proxy returns the response + +[include a diagram here] + + +Before getting started with the Connect proxy, make sure you've already gone through the [managed auth quickstart](/connect/managed-auth) for Pipedream Connect. + + +## Getting started + +You can send requests to the Connect proxy using: + +- A REST API (`/v1/connect/{projectId}/proxy`) # fix this ref +- Or via the [Pipedream SDK](/connect/sdk) with a fetch-style interface (`makeProxyRequest`) + +To make the request to the Connect proxy, you'll need: + +- A Pipedream OAuth client to make authenticated requests to Pipedream's API # add a link +- The external user ID for your end user (ex, `abc-123`) # add link +- Connect environment (ex, `production` or `development`) # add link +- The account ID for your end user's connected account (ex, `apn_1234567`) # add a link to accounts endpoint + +For the downstream API request, you'll need: + +### URL +- The URL of the API you want to call (ex, `https://slack.com/api/chat.postMessage`) +- If using the REST API, this should be a Base64 encoded string appended to the end of the proxy URL. For example: + +``` +https://api.pipedream.com/v1/connect/{projectId}/proxy/{base64EncodedURLString} + +# make sure that's right +``` + +### HTTP method and body +- When sending a request to the Connect proxy, use the HTTP method that the downstream API requires +- The body (if applicable) should be included in the request body + +### Headers +- You can send headers to Pipedream and you can also include headers to send to the downstream APIs +- For Pipedream headers, use the `x-pd-` prefix. For example: + +``` +x-pd-external-user-id: abc-123 +x-pd-environment: production +``` + +- For downstream API headers, don't prepend with anything, and we'll forward them as-is + + +#### Code examples + +Deploy a trigger component that will emit events to a webhook or workflow for a Pipedream Connect user. + +```text +POST /triggers/deploy +``` + +##### Body parameters + +`id` **string** + +The key that identifies the action component (see the [component structure +table](/components/api#component-structure)). + +--- + +`configured_props` **object** + +The props that have already been configured for the component. This is a +JSON-serializable object with the prop names as keys and the configured values +as values. + +--- + +`external_user_id` **string** + +[The external user ID](/connect/api/#external-users) in your system on behalf of +which you want to execute the action. + +--- + +`webhook_url` **string** (_optional_) + +The URL to which the trigger will send events. + +--- + +`workflow_url` **string** (_optional_) + +The Pipedream workflow ID to which you want to emit events (ex, `p_1234567`). + + +The workflow must be in the same Pipedream project as the trigger. + + +--- + +`dynamic_props_id` **string** (_optional_) + +The ID of the last prop reconfiguration (if applicable). + +##### Examples + + + + +```javascript +import { createBackendClient } from "@pipedream/sdk/server"; + +const prodClient = createBackendClient({ + environment: {environment}, + projectId: {your_projectId}, + credentials: { + clientId: {your_oauth_client_id}, + clientSecret: {your_oauth_client_secret} + }, +}); + +const prodUrl = "{api_url_you_want_to_call}" +const prodOptions = { + account_id: "{account_id}", // The account ID for your end user (ex, apn_1234567) + external_user_id: "{external_user_id}", // The external user ID for your end user +} + +try { +//const resp = await client.makeProxyRequest("https://eogeajyqofyfi86.m.pipedream2.net/hello/world?query=boo&foo=bar", +const resp = await prodClient.makeProxyRequest( + prodUrl, + prodOptions, + { + method: "POST", + body: { + hello: "world", + }, + headers: { + "test-header": "hi", + "xxxxxxxxx": "aaaaaaaaaa" + }, +}) +console.log(`resp: ${JSON.stringify(resp)}`); +} catch (e) { + console.log(e.response) + console.error(e); +} + +// Parse and return the data you need +``` + + + +```bash +# First, obtain an OAuth access token +curl -X POST https://api.pipedream.com/v1/oauth/token \ + -H "Content-Type: application/json" \ + -d '{ + "grant_type": "client_credentials", + "client_id": "{oauth_client_id}", + "client_secret": "{oauth_client_secret}" + }' + +# The response will include an access_token. Use it in the Authorization header below. +# This request will deploy the "New Issue (Instant)" trigger for the Gitlab app. + +echo '{ + "external_user_id": "jverce", + "id": "gitlab-new-issue", + "configured_props": { + "gitlab": { + "authProvisionId": "apn_kVh9AoD" + }, + "projectId": 45672541, + }, + "webhook_url": "https://events.example.com/gitlab-new-issue" +}' > data.json + +curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/triggers/deploy" \ + -H "Authorization: Bearer {access_token}" \ + -H "Content-Type: application/json" \ + -d @data.json +``` + + + \ No newline at end of file From a118e0265d38c08140ceffca7931b5b837005a1b Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 3 Feb 2025 16:28:52 -0800 Subject: [PATCH 02/20] checking work in; need to add redirects for dir changes --- docs-v2/pages/_meta.tsx | 2 +- docs-v2/pages/connect/_meta.tsx | 29 +++++-------------- docs-v2/pages/connect/managed-auth/_meta.tsx | 9 ++++++ .../{ => managed-auth}/connect-link.mdx | 0 .../{ => managed-auth}/customize-your-app.mdx | 0 docs-v2/pages/connect/managed-auth/index.mdx | 0 .../{ => managed-auth}/oauth-clients.mdx | 0 .../connect/{ => managed-auth}/quickstart.mdx | 0 .../connect/{ => managed-auth}/tokens.mdx | 0 .../connect/{ => managed-auth}/webhooks.mdx | 0 docs-v2/pages/rest-api/auth.mdx | 5 +--- 11 files changed, 18 insertions(+), 27 deletions(-) create mode 100644 docs-v2/pages/connect/managed-auth/_meta.tsx rename docs-v2/pages/connect/{ => managed-auth}/connect-link.mdx (100%) rename docs-v2/pages/connect/{ => managed-auth}/customize-your-app.mdx (100%) create mode 100644 docs-v2/pages/connect/managed-auth/index.mdx rename docs-v2/pages/connect/{ => managed-auth}/oauth-clients.mdx (100%) rename docs-v2/pages/connect/{ => managed-auth}/quickstart.mdx (100%) rename docs-v2/pages/connect/{ => managed-auth}/tokens.mdx (100%) rename docs-v2/pages/connect/{ => managed-auth}/webhooks.mdx (100%) diff --git a/docs-v2/pages/_meta.tsx b/docs-v2/pages/_meta.tsx index 4a817bb34cdb3..42ddc6480d3f1 100644 --- a/docs-v2/pages/_meta.tsx +++ b/docs-v2/pages/_meta.tsx @@ -5,7 +5,7 @@ export default { "projects": "Projects", "workflows": "Workflows", "connect": { - title: "Pipedream Connect", + title: "Connect", }, "code": "Code", "data-stores": "Data Stores", diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index 153f34fc99729..576efa9461c7a 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -5,38 +5,23 @@ export default { "use-cases": { "title": "Use cases", }, - "quickstart": { - "title": "Managed auth", - }, - "workflows": { - "title": "Running workflows", + "managed-auth": { + "title": "Managed authentication", }, "components": { - "title": "Embedding components", - }, - "api": { - "title": "API & SDK reference", + "title": "Pre-built tools", }, "api-proxy": { "title": "API proxy", }, - "tokens": { - "title": "Connect tokens", + "workflows": { + "title": "Workflows", }, "environments": { "title": "Environments", }, - "oauth-clients": { - "title": "OAuth clients", - }, - "webhooks": { - "title": "Webhooks", - }, - "connect-link": { - "title": "Connect Link", - }, - "customize-your-app": { - "title": "Customize your app", + "api": { + "title": "API & SDK reference", }, "troubleshooting": { "title": "Troubleshooting", diff --git a/docs-v2/pages/connect/managed-auth/_meta.tsx b/docs-v2/pages/connect/managed-auth/_meta.tsx new file mode 100644 index 0000000000000..3e997a516e4e4 --- /dev/null +++ b/docs-v2/pages/connect/managed-auth/_meta.tsx @@ -0,0 +1,9 @@ +export default { + "index": "Overview", + "quickstart": "Quickstart", + "tokens": "Connect Tokens", + "connect-link": "Connect Link", + "oauth-clients": "OAuth clients", + "webhooks": "Webhooks", + "customize-your-app": "Customize your app", +} as const diff --git a/docs-v2/pages/connect/connect-link.mdx b/docs-v2/pages/connect/managed-auth/connect-link.mdx similarity index 100% rename from docs-v2/pages/connect/connect-link.mdx rename to docs-v2/pages/connect/managed-auth/connect-link.mdx diff --git a/docs-v2/pages/connect/customize-your-app.mdx b/docs-v2/pages/connect/managed-auth/customize-your-app.mdx similarity index 100% rename from docs-v2/pages/connect/customize-your-app.mdx rename to docs-v2/pages/connect/managed-auth/customize-your-app.mdx diff --git a/docs-v2/pages/connect/managed-auth/index.mdx b/docs-v2/pages/connect/managed-auth/index.mdx new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/docs-v2/pages/connect/oauth-clients.mdx b/docs-v2/pages/connect/managed-auth/oauth-clients.mdx similarity index 100% rename from docs-v2/pages/connect/oauth-clients.mdx rename to docs-v2/pages/connect/managed-auth/oauth-clients.mdx diff --git a/docs-v2/pages/connect/quickstart.mdx b/docs-v2/pages/connect/managed-auth/quickstart.mdx similarity index 100% rename from docs-v2/pages/connect/quickstart.mdx rename to docs-v2/pages/connect/managed-auth/quickstart.mdx diff --git a/docs-v2/pages/connect/tokens.mdx b/docs-v2/pages/connect/managed-auth/tokens.mdx similarity index 100% rename from docs-v2/pages/connect/tokens.mdx rename to docs-v2/pages/connect/managed-auth/tokens.mdx diff --git a/docs-v2/pages/connect/webhooks.mdx b/docs-v2/pages/connect/managed-auth/webhooks.mdx similarity index 100% rename from docs-v2/pages/connect/webhooks.mdx rename to docs-v2/pages/connect/managed-auth/webhooks.mdx diff --git a/docs-v2/pages/rest-api/auth.mdx b/docs-v2/pages/rest-api/auth.mdx index 531a8fee30893..0eaf4df7cf8a3 100644 --- a/docs-v2/pages/rest-api/auth.mdx +++ b/docs-v2/pages/rest-api/auth.mdx @@ -46,11 +46,8 @@ const pd = createBackendClient({ const accounts = await pd.getAccounts({ include_credentials: 1 }); // Or make any Pipedream API request with the fresh token -const accounts = await pd.makeRequest("/accounts", { +const accounts = await pd.makeAuthorizedRequest("/accounts", { method: "GET" - headers: { - "Authorization": await this.oauthAuthorizationHeader(), // Automatically uses a fresh token - }, params: { include_credentials: 1, } From abf0bbe48456bea4b1174429a72bb856d3b49a6e Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 3 Feb 2025 16:30:07 -0800 Subject: [PATCH 03/20] pnpm-lock --- pnpm-lock.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bac7b6366b43d..6c9868944a0be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10285,8 +10285,7 @@ importers: specifier: ^3.0.1 version: 3.0.3 - components/storerocket: - specifiers: {} + components/storerocket: {} components/stormboard: {} @@ -32103,6 +32102,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: From 1eeebea3ffad3b4fa3e7fa1a9a149d6ba2b294b3 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 3 Feb 2025 22:08:18 -0800 Subject: [PATCH 04/20] More progress, still WIP --- docs-v2/pages/connect/index.mdx | 51 ++++++-------------- docs-v2/pages/connect/managed-auth/_meta.tsx | 1 + docs-v2/pages/connect/managed-auth/users.mdx | 17 +++++++ docs-v2/pages/rest-api/auth.mdx | 1 + 4 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 docs-v2/pages/connect/managed-auth/users.mdx diff --git a/docs-v2/pages/connect/index.mdx b/docs-v2/pages/connect/index.mdx index 62be37755386f..822ba73e8d8ea 100644 --- a/docs-v2/pages/connect/index.mdx +++ b/docs-v2/pages/connect/index.mdx @@ -5,28 +5,31 @@ import VideoPlayer from "@/components/VideoPlayer"; # Pipedream Connect -Pipedream Connect is the easiest way for your users to connect to [over {process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps), **right in your product**. You can build in-app messaging, CRM syncs, AI agents, [and much more](/connect/use-cases), all in a few minutes. Visit [the quickstart](/connect/quickstart) to build your first integration. +**Connect provides a developer toolkit that lets you add {process.env.PUBLIC_APPS}+ integrations to your app or AI agent.** You can build AI agents, in-app messaging, CRM syncs, [and much more](/connect/use-cases), all in a few minutes. You have full, code-level control over how these integrations work in your app. You handle your product, Pipedream simplifies the integration. -You have full, code-level control over how these integrations work in your app. You handle your product, Pipedream simplifies the integration. +## Use managed auth -Connect lets you: +- Handle authorization or accept API keys on behalf of your users, for any of Pipedream's [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) +- Use the [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) or [Connect Link](/connect/quickstart#or-use-connect-link) to accept auth in minutes +- Ship new integrations quickly by using Pipedream's approved OAuth clients -1. Handle authorization or accept API keys on behalf of your users, for any of Pipedream's [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps). Use the [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) or [Connect Link](/connect/quickstart#or-use-connect-link) to accept auth in minutes. -2. Securely retrieve OAuth access tokens, API keys, and other credentials for your end users with Pipedream's [REST API](/connect/api). -3. [Embed any Pipedream action or trigger](/connect/components) to run on behalf of your users, directly from within your application. -4. [Run workflows](/connect/workflows) for your end users with Pipedream's [workflow builder](/workflows), [serverless runtime](/), and thousands of no-code [triggers](/workflows/triggers) and [actions](/workflows/actions). Build complex integrations in minutes, writing code when you need it and using no-code components when you don't. Pipedream workflows are easy to modify, debug, and scale. -
+## Act on behalf of your users -Pipedream Connect overview +- Retrieve OAuth access tokens and API keys for your end users with Pipedream's [REST API](/connect/api) +- Add 10k pre-built tools and triggers from {process.env.PUBLIC_APPS}+ APIs to your AI agent or embed them directly in your SaaS app +- Develop and deploy complex multi-step [workflows](/connect/workflows) in our [visual workflow builder](/workflows) +- Use the Connect proxy to make custom API requests + +{/* Pipedream Connect overview */} ## Use cases Pipedream Connect lets you build any API integration into your product in minutes. Our customers build: +- **AI products**: Talk to any AI API or LLM, interacting with your users or running AI-driven asynchronous tasks - **In-app messaging**: Send messages to Slack, Discord, Microsoft Teams, or any app directly from your product. - **CRM syncs**: Sync data between your app and Salesforce, HubSpot, or any CRM -- **AI products**: Talk to any AI API or LLM, interacting with your users or running AI-driven asynchronous tasks - **Spreadsheet integrations**: Sync data between your app and Google Sheets, Airtable, or any spreadsheet [and much more](/connect/use-cases). @@ -35,33 +38,9 @@ Pipedream Connect lets you build any API integration into your product in minute Visit [the managed auth quickstart](/connect/quickstart) to build your first integration. -## App configuration for OAuth apps - -Pipedream has more than {process.env.PUBLIC_APPS} apps available for you to integrate via Connect. Getting started is easy — just follow the [quickstart](/connect/quickstart) to get up and running. - -By default, apps that use OAuth to authenticate will use Pipedream's OAuth client. Depending on your use case, you may need to configure your own OAuth client. Read more about OAuth clients in Pipedream [here](/connected-accounts/oauth-clients). - -[Let us know](https://pipedream.com/support) if the app you're looking for isn't listed [here](https://pipedream.com/apps). - -## Users - -To view or delete your users' connected accounts: - -1. Open your project in Pipedream -2. Click the **Connect** tab on the left -3. Click the **Users** tab at the top - -You'll see a list of all users, their connected accounts, and the option to delete any accounts from the UI. You can also retrieve and delete all your users via the API ([see the docs for reference](/connect/api)). - - -Connect currently supports one connected account per user, app, environment combination. - -So if user `abc-123` in your application connects their Slack account in `production`, then that same user connects a different Slack workspace (also in `production`), the first connected account will get overwritten in Pipedream and replaced by the second. - - ## Plans and pricing -**Managed authentication with Connect is free to use for up to 1,000 connected accounts for any workspace**. Check out our [pricing page](https://pipedream.com/pricing?plan=Enterprise) for details on running workflows and embedding components in your app. +**Managed authentication with Connect is free to use for up to 1,000 connected accounts for any workspace**. Check out our [pricing page](https://pipedream.com/pricing?plan=Enterprise) to get in touch with our Sales team for details on using Connect in production. ## Security @@ -84,4 +63,4 @@ All credentials and tokens are sent to Pipedream securely over HTTPS, and encryp - **Developer**: This is probably you, the Pipedream customer who's developing an app and wants to use Connect to make API requests on behalf of your end users. - **End User**: Your customer or user, whose data you want to access on their behalf. End users are identifed via the `external_user_id` param in the Connect SDK and API. - **Connected Account**: The account your end user connects. [Read more about connected accounts](/connected-accounts). -- **OAuth Client**: Custom OAuth clients you create in Pipedream. [Read more about OAuth clients](/connected-accounts/oauth-clients). +- **OAuth Client**: This is admittedly a bit of an overloaded term and refers both to [custom OAuth clients](/connect/managed-auth/oauth-clients) you create in Pipedream to use when your end users authorize access to their account, as well as [OAuth clients to authenticate to Pipedream's API](/rest-api/auth#oauth). diff --git a/docs-v2/pages/connect/managed-auth/_meta.tsx b/docs-v2/pages/connect/managed-auth/_meta.tsx index 3e997a516e4e4..0ea5ce14ea863 100644 --- a/docs-v2/pages/connect/managed-auth/_meta.tsx +++ b/docs-v2/pages/connect/managed-auth/_meta.tsx @@ -1,5 +1,6 @@ export default { "index": "Overview", + "users": "Users", "quickstart": "Quickstart", "tokens": "Connect Tokens", "connect-link": "Connect Link", diff --git a/docs-v2/pages/connect/managed-auth/users.mdx b/docs-v2/pages/connect/managed-auth/users.mdx new file mode 100644 index 0000000000000..eaf8819b057f0 --- /dev/null +++ b/docs-v2/pages/connect/managed-auth/users.mdx @@ -0,0 +1,17 @@ +import Callout from '@/components/Callout' + +# Users + +To view or delete your users' connected accounts: + +1. Open your project in Pipedream +2. Click the **Connect** tab on the left +3. Click the **Users** tab at the top + +You'll see a list of all users, their connected accounts, and the option to delete any accounts from the UI. You can also retrieve and delete all your users via the API ([see the docs for reference](/connect/api)). + + +Connect currently supports one connected account per user, app, environment combination. + +So if user `abc-123` in your application connects their Slack account in `production`, then that same user connects a different Slack workspace (also in `production`), the first connected account will get overwritten in Pipedream and replaced by the second. + \ No newline at end of file diff --git a/docs-v2/pages/rest-api/auth.mdx b/docs-v2/pages/rest-api/auth.mdx index 0eaf4df7cf8a3..b40caca6d52fe 100644 --- a/docs-v2/pages/rest-api/auth.mdx +++ b/docs-v2/pages/rest-api/auth.mdx @@ -40,6 +40,7 @@ const pd = createBackendClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET", }, + projectId: "YOUR_PROJECT_ID", // This is typically required for most Connect API endpoints }); // Use the SDK's helper methods to make requests From fcaed8ad6a3ad639e9d841794df91c8f32c975dd Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 12:23:38 -0800 Subject: [PATCH 05/20] More docs progress --- docs-v2/pages/connect/_meta.tsx | 2 +- docs-v2/pages/connect/api-proxy.mdx | 159 +++++------------- docs-v2/pages/connect/components.mdx | 12 +- docs-v2/pages/connect/index.mdx | 2 +- docs-v2/pages/connect/managed-auth/_meta.tsx | 4 +- ...stomize-your-app.mdx => customization.mdx} | 0 6 files changed, 49 insertions(+), 130 deletions(-) rename docs-v2/pages/connect/managed-auth/{customize-your-app.mdx => customization.mdx} (100%) diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index 576efa9461c7a..a53b7c0718ea4 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -6,7 +6,7 @@ export default { "title": "Use cases", }, "managed-auth": { - "title": "Managed authentication", + "title": "Managed auth", }, "components": { "title": "Pre-built tools", diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 4021ece23bb9b..28aa52ae7cdf2 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -3,120 +3,56 @@ import Callout from '@/components/Callout' # Connect Proxy -Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful for a few scenarios: +Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful in a few scenarios: 1. You need code-level control and you want to use [Pipedream's OAuth](/connect/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/oauth-clients#using-your-own-oauth-client) -2. There isn't a [pre-built action](/connect/components) for the app, or you need to modify the request +2. There isn't a [pre-built tool](/connect/components) (action) for the app, or you need to modify the request +3. You want to avoid storing end user credentials in your app ## Overview The Connect proxy enables you to interface with any integrated API and make authenticated requests on behalf of your users, without dealing with OAuth or storing end user credentials. - You send a request to the proxy and identify the end user you want to act on behalf of -- The proxy then makes the request to the downstream API and injects your end user's auth credentials -- The proxy returns the response +- The proxy sends the request to the downstream API and dynamically inserts your end user's auth credentials +- The proxy returns the response from the downstream API back to you [include a diagram here] -Before getting started with the Connect proxy, make sure you've already gone through the [managed auth quickstart](/connect/managed-auth) for Pipedream Connect. +Before getting started with the Connect proxy, make sure you've already gone through the [managed auth quickstart](/connect/managed-auth/quickstart) for Pipedream Connect. ## Getting started -You can send requests to the Connect proxy using: - -- A REST API (`/v1/connect/{projectId}/proxy`) # fix this ref -- Or via the [Pipedream SDK](/connect/sdk) with a fetch-style interface (`makeProxyRequest`) - -To make the request to the Connect proxy, you'll need: +You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sdk) with a fetch-style interface, or by making a request to the [REST API](/rest-api/connect/proxy). - A Pipedream OAuth client to make authenticated requests to Pipedream's API # add a link - The external user ID for your end user (ex, `abc-123`) # add link - Connect environment (ex, `production` or `development`) # add link - The account ID for your end user's connected account (ex, `apn_1234567`) # add a link to accounts endpoint -For the downstream API request, you'll need: - -### URL -- The URL of the API you want to call (ex, `https://slack.com/api/chat.postMessage`) -- If using the REST API, this should be a Base64 encoded string appended to the end of the proxy URL. For example: - -``` -https://api.pipedream.com/v1/connect/{projectId}/proxy/{base64EncodedURLString} - -# make sure that's right -``` - -### HTTP method and body -- When sending a request to the Connect proxy, use the HTTP method that the downstream API requires -- The body (if applicable) should be included in the request body - -### Headers -- You can send headers to Pipedream and you can also include headers to send to the downstream APIs -- For Pipedream headers, use the `x-pd-` prefix. For example: - -``` -x-pd-external-user-id: abc-123 -x-pd-environment: production -``` - -- For downstream API headers, don't prepend with anything, and we'll forward them as-is - - -#### Code examples - -Deploy a trigger component that will emit events to a webhook or workflow for a Pipedream Connect user. - -```text -POST /triggers/deploy -``` - -##### Body parameters +### Code examples -`id` **string** +**URL** -The key that identifies the action component (see the [component structure -table](/components/api#component-structure)). - ---- - -`configured_props` **object** - -The props that have already been configured for the component. This is a -JSON-serializable object with the prop names as keys and the configured values -as values. - ---- - -`external_user_id` **string** - -[The external user ID](/connect/api/#external-users) in your system on behalf of -which you want to execute the action. - ---- - -`webhook_url` **string** (_optional_) - -The URL to which the trigger will send events. - ---- +- The URL of the API you want to call (ex, `https://slack.com/api/chat.postMessage`) +- If using the REST API, this should be an URL-safe Base64 encoded string (ex, `aHR0cHM6Ly9zbGFjay5jb20vYXBpL2NoYXQucG9zdE1lc3NhZ2U`) -`workflow_url` **string** (_optional_) +**HTTP method** -The Pipedream workflow ID to which you want to emit events (ex, `p_1234567`). +- Use the HTTP method required by the downstream API - -The workflow must be in the same Pipedream project as the trigger. - +**Body** ---- +- Optionally include a body to send to the downstream API -`dynamic_props_id` **string** (_optional_) +**Headers** -The ID of the last prop reconfiguration (if applicable). +- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`). **This does not get forwarded to the downstream API.** +- Any other headers you include will be forwarded to the downstream API, with the exception of those with the `x-pd-` prefix +- For downstream API headers, don't prepend with anything, and we'll forward them as-is. For example: -##### Examples @@ -124,8 +60,8 @@ The ID of the last prop reconfiguration (if applicable). ```javascript import { createBackendClient } from "@pipedream/sdk/server"; -const prodClient = createBackendClient({ - environment: {environment}, +const pd = createBackendClient({ + environment: {development | production}, projectId: {your_projectId}, credentials: { clientId: {your_oauth_client_id}, @@ -133,34 +69,25 @@ const prodClient = createBackendClient({ }, }); -const prodUrl = "{api_url_you_want_to_call}" -const prodOptions = { +const url = "https://slack.com/api/chat.postMessage" +const options = { account_id: "{account_id}", // The account ID for your end user (ex, apn_1234567) external_user_id: "{external_user_id}", // The external user ID for your end user } -try { -//const resp = await client.makeProxyRequest("https://eogeajyqofyfi86.m.pipedream2.net/hello/world?query=boo&foo=bar", -const resp = await prodClient.makeProxyRequest( - prodUrl, - prodOptions, +const resp = await pd.makeProxyRequest( + url, + options, { method: "POST", body: { - hello: "world", - }, - headers: { - "test-header": "hi", - "xxxxxxxxx": "aaaaaaaaaa" + text: "hello, world", + channel: "C03NA8B4VA9" }, }) -console.log(`resp: ${JSON.stringify(resp)}`); -} catch (e) { - console.log(e.response) - console.error(e); -} // Parse and return the data you need +console.log(resp); ``` @@ -171,29 +98,21 @@ curl -X POST https://api.pipedream.com/v1/oauth/token \ -H "Content-Type: application/json" \ -d '{ "grant_type": "client_credentials", - "client_id": "{oauth_client_id}", - "client_secret": "{oauth_client_secret}" + "client_id": "{your_oauth_client_id}", + "client_secret": "{your_oauth_client_secret}" }' # The response will include an access_token. Use it in the Authorization header below. -# This request will deploy the "New Issue (Instant)" trigger for the Gitlab app. - -echo '{ - "external_user_id": "jverce", - "id": "gitlab-new-issue", - "configured_props": { - "gitlab": { - "authProvisionId": "apn_kVh9AoD" - }, - "projectId": 45672541, - }, - "webhook_url": "https://events.example.com/gitlab-new-issue" -}' > data.json -curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/triggers/deploy" \ +curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/proxy/{url_safe_base64_encoded_url}?external_user_id={external_user_id}&account_id={apn_xxxxxxx}" \ -H "Authorization: Bearer {access_token}" \ - -H "Content-Type: application/json" \ - -d @data.json + -H "x-pd-environment: {development | production}" \ + -d '{ + "text": "hello, world", + "channel": "C03NA8B4VA9" + }' + +# Parse and return the data you need ``` diff --git a/docs-v2/pages/connect/components.mdx b/docs-v2/pages/connect/components.mdx index 1be6ec5f0c3dd..115ca6067a670 100644 --- a/docs-v2/pages/connect/components.mdx +++ b/docs-v2/pages/connect/components.mdx @@ -1,20 +1,20 @@ import { Steps, Tabs } from 'nextra/components' import Callout from '@/components/Callout' -# Embedding components in your application +# Pre-built tools for your app or agent -Pipedream Connect provides APIs to embed [pre-built components](/components) directly in your application -or AI agent, unlocking access to {process.env.REGISTRY_COMPONENTS}+ pre-built API operations. Enable [your end users](/connect/api#external-users) to +Pipedream Connect provides APIs to embed pre-built tools ([triggers and actions](/components)) directly in your application +or AI agent, enabling access to 10,000+ built-in API operations. Enable [your end users](/connect/api#external-users) to configure, deploy, and invoke Pipedream triggers and actions for more than {process.env.PUBLIC_APPS} APIs. -## What are components? +## What are triggers and actions? -In Pipedream, [components](/components) are self-contained executable units of code. Your end users configure the inputs and the components produce a +In Pipedream, we call triggers and actions [components](/components), which are self-contained executable units of code. Your end users configure the inputs and these components produce a result that's exported as output. These components are developed and maintained by Pipedream and our community and their source code is available in our [public Github repo](https://github.com/PipedreamHQ/pipedream/tree/master/components). -Running components for your end users via Pipedream Connect is in **beta**, and we're looking for feedback. Please [let us know](https://pipedream.com/support) how you're using it, what's not working, and what else you'd like to see. +This feature is in **beta**, and we're looking for feedback. Please [let us know](https://pipedream.com/support) how you're using it, what's not working, and what else you'd like to see. ## Getting started diff --git a/docs-v2/pages/connect/index.mdx b/docs-v2/pages/connect/index.mdx index 822ba73e8d8ea..b33a72bef8286 100644 --- a/docs-v2/pages/connect/index.mdx +++ b/docs-v2/pages/connect/index.mdx @@ -11,7 +11,7 @@ import VideoPlayer from "@/components/VideoPlayer"; - Handle authorization or accept API keys on behalf of your users, for any of Pipedream's [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) - Use the [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) or [Connect Link](/connect/quickstart#or-use-connect-link) to accept auth in minutes -- Ship new integrations quickly by using Pipedream's approved OAuth clients +- Ship new integrations quickly with Pipedream's approved OAuth clients, or use your own ## Act on behalf of your users diff --git a/docs-v2/pages/connect/managed-auth/_meta.tsx b/docs-v2/pages/connect/managed-auth/_meta.tsx index 0ea5ce14ea863..fd1e8d5f42b21 100644 --- a/docs-v2/pages/connect/managed-auth/_meta.tsx +++ b/docs-v2/pages/connect/managed-auth/_meta.tsx @@ -4,7 +4,7 @@ export default { "quickstart": "Quickstart", "tokens": "Connect Tokens", "connect-link": "Connect Link", - "oauth-clients": "OAuth clients", + "oauth-clients": "OAuth Clients", "webhooks": "Webhooks", - "customize-your-app": "Customize your app", + "customization": "Customization", } as const diff --git a/docs-v2/pages/connect/managed-auth/customize-your-app.mdx b/docs-v2/pages/connect/managed-auth/customization.mdx similarity index 100% rename from docs-v2/pages/connect/managed-auth/customize-your-app.mdx rename to docs-v2/pages/connect/managed-auth/customization.mdx From 62fc17f12d0f70d93856dd081986b78102df44c0 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 12:58:32 -0800 Subject: [PATCH 06/20] Adding redirects to handle directory changes --- docs-v2/vercel.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs-v2/vercel.json b/docs-v2/vercel.json index 8a7d4e042f637..659e0f992a182 100644 --- a/docs-v2/vercel.json +++ b/docs-v2/vercel.json @@ -289,6 +289,30 @@ { "source": "/docs/connect/quickstart#connect-a-users-account", "destination": "/docs/connect/quickstart#connect-your-users-account" + }, + { + "source": "/docs/connect/connect-link", + "destination": "/docs/connect/managed-auth/connect-link" + }, + { + "source": "/docs/connect/customize-your-app", + "destination": "/docs/connect/managed-auth/customization" + }, + { + "source": "/docs/connect/oauth-clients", + "destination": "/docs/connect/managed-auth/oauth-clients" + }, + { + "source": "/docs/connect/quickstart", + "destination": "/docs/connect/managed-auth/quickstart" + }, + { + "source": "/docs/connect/tokens", + "destination": "/docs/connect/managed-auth/tokens" + }, + { + "source": "/docs/connect/webhooks", + "destination": "/docs/connect/managed-auth/webhooks" } ] } From 1aa8dfcb6ae5578a71859a5b14fd41698bb51d4d Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 13:18:48 -0800 Subject: [PATCH 07/20] Fixing broken link refs --- docs-v2/pages/connect/api-proxy.mdx | 2 +- docs-v2/pages/connect/api.mdx | 10 +++++----- docs-v2/pages/connect/index.mdx | 4 ++-- docs-v2/pages/connect/managed-auth/connect-link.mdx | 4 ++-- docs-v2/pages/connect/managed-auth/oauth-clients.mdx | 4 ++-- docs-v2/pages/connect/managed-auth/webhooks.mdx | 2 +- docs-v2/pages/connect/troubleshooting.mdx | 2 +- docs-v2/pages/connect/workflows.mdx | 8 ++++---- docs-v2/pages/rest-api/index.mdx | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 28aa52ae7cdf2..bde1de5f2f561 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -5,7 +5,7 @@ import Callout from '@/components/Callout' Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful in a few scenarios: -1. You need code-level control and you want to use [Pipedream's OAuth](/connect/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/oauth-clients#using-your-own-oauth-client) +1. You need code-level control and you want to use [Pipedream's OAuth](/connect/managed-auth/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/managed-auth/oauth-clients#using-your-own-oauth-client) 2. There isn't a [pre-built tool](/connect/components) (action) for the app, or you need to modify the request 3. You want to avoid storing end user credentials in your app diff --git a/docs-v2/pages/connect/api.mdx b/docs-v2/pages/connect/api.mdx index b2b2bca20afbe..b29f526de8d09 100644 --- a/docs-v2/pages/connect/api.mdx +++ b/docs-v2/pages/connect/api.mdx @@ -70,7 +70,7 @@ You'll primarily use the browser SDK to let your users securely connect apps fro 1. [Create a short-lived token on your server](#create-a-new-token) 2. Initiate auth with that token to securely connect an account for a specific user -Here's a Next.js example [from our quickstart](/connect/quickstart): +Here's a Next.js example [from our quickstart](/connect/managed-auth/quickstart): ```typescript import { createFrontendClient } from "@pipedream/sdk/browser" @@ -408,7 +408,7 @@ You can find the app's ID in the response from the [List apps](/rest-api#list-ap `oauth_app_id` **string** (_optional_) -The ID of the [OAuth app](/connect/quickstart#create-a-pipedream-oauth-client) you'd like to retrieve accounts for. +The ID of the [OAuth app](/connect/managed-auth/quickstart#create-a-pipedream-oauth-client) you'd like to retrieve accounts for. --- @@ -427,7 +427,7 @@ Never return user credentials to the client -To retrieve the credentials for any account in `production` for OAuth apps (Slack, Google Sheets, etc), the connected account must be using [your own OAuth client](/connect/oauth-clients#using-a-custom-oauth-client). You can only retrieve end user credentials for accounts that are using Pipedream's OAuth clients in `development`. [Learn more here](/connect/oauth-clients#using-pipedream-oauth). +To retrieve the credentials for any account in `production` for OAuth apps (Slack, Google Sheets, etc), the connected account must be using [your own OAuth client](/connect/managed-auth/oauth-clients#using-a-custom-oauth-client). You can only retrieve end user credentials for accounts that are using Pipedream's OAuth clients in `development`. [Learn more here](/connect/managed-auth/oauth-clients#using-pipedream-oauth). ##### Examples @@ -680,7 +680,7 @@ Never return user credentials to the client -To retrieve the credentials for any account in `production` for OAuth apps (Slack, Google Sheets, etc), the connected account must be using [your own OAuth client](/connect/oauth-clients#using-a-custom-oauth-client). You can only retrieve end user credentials for accounts that are using Pipedream's OAuth clients in `development`. [Learn more here](/connect/oauth-clients#using-pipedream-oauth). +To retrieve the credentials for any account in `production` for OAuth apps (Slack, Google Sheets, etc), the connected account must be using [your own OAuth client](/connect/managed-auth/oauth-clients#using-a-custom-oauth-client). You can only retrieve end user credentials for accounts that are using Pipedream's OAuth clients in `development`. [Learn more here](/connect/managed-auth/oauth-clients#using-pipedream-oauth). ##### Examples @@ -927,7 +927,7 @@ DELETE /{project_id}/apps/{app_id}/accounts `app_id` **string** -The app ID for which you want to delete all connected accounts. `app_id` can be `oauth_app_id` for [OAuth apps](/connect/quickstart#create-a-pipedream-oauth-client) or name slug for key-based apps, which you can find under the **Authentication** section of any [app page](https://pipedream.com/apps) +The app ID for which you want to delete all connected accounts. `app_id` can be `oauth_app_id` for [OAuth apps](/connect/managed-auth/quickstart#create-a-pipedream-oauth-client) or name slug for key-based apps, which you can find under the **Authentication** section of any [app page](https://pipedream.com/apps) ##### Examples diff --git a/docs-v2/pages/connect/index.mdx b/docs-v2/pages/connect/index.mdx index b33a72bef8286..d1e1a30733ec6 100644 --- a/docs-v2/pages/connect/index.mdx +++ b/docs-v2/pages/connect/index.mdx @@ -10,14 +10,14 @@ import VideoPlayer from "@/components/VideoPlayer"; ## Use managed auth - Handle authorization or accept API keys on behalf of your users, for any of Pipedream's [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) -- Use the [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) or [Connect Link](/connect/quickstart#or-use-connect-link) to accept auth in minutes +- Use the [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) or [Connect Link](/connect/managed-auth/quickstart#or-use-connect-link) to accept auth in minutes - Ship new integrations quickly with Pipedream's approved OAuth clients, or use your own ## Act on behalf of your users - Retrieve OAuth access tokens and API keys for your end users with Pipedream's [REST API](/connect/api) -- Add 10k pre-built tools and triggers from {process.env.PUBLIC_APPS}+ APIs to your AI agent or embed them directly in your SaaS app +- Add 10,000+ pre-built tools and triggers from {process.env.PUBLIC_APPS}+ APIs to your AI agent or embed them directly in your SaaS app - Develop and deploy complex multi-step [workflows](/connect/workflows) in our [visual workflow builder](/workflows) - Use the Connect proxy to make custom API requests diff --git a/docs-v2/pages/connect/managed-auth/connect-link.mdx b/docs-v2/pages/connect/managed-auth/connect-link.mdx index be765308c317a..d10a161989d01 100644 --- a/docs-v2/pages/connect/managed-auth/connect-link.mdx +++ b/docs-v2/pages/connect/managed-auth/connect-link.mdx @@ -8,11 +8,11 @@ If you aren't able to execute JavaScript or open an iFrame in your frontend, or ## How to generate a link -See [the Connect quickstart](/connect/quickstart) for a full tutorial for getting Connect up and running. +See [the Connect quickstart](/connect/managed-auth/quickstart) for a full tutorial for getting Connect up and running. Here's a quick overview of how to generate a Connect Link URL: -1. First, [generate a token](/connect/quickstart/#generate-a-short-lived-token) for your users. +1. First, [generate a token](/connect/managed-auth/quickstart/#generate-a-short-lived-token) for your users. 2. Extract the `connect_link_url` from the token response. 3. Before returning the URL to your user, add an `app` parameter to the end of the query string: diff --git a/docs-v2/pages/connect/managed-auth/oauth-clients.mdx b/docs-v2/pages/connect/managed-auth/oauth-clients.mdx index f865b0774d1fc..d634442cec546 100644 --- a/docs-v2/pages/connect/managed-auth/oauth-clients.mdx +++ b/docs-v2/pages/connect/managed-auth/oauth-clients.mdx @@ -29,8 +29,8 @@ For any OAuth app that supports it, **you can always use your own client.** Your ## Using a custom OAuth client 1. Follow the steps [here](/connected-accounts/oauth-clients#configuring-custom-oauth-clients) to create an OAuth client in Pipedream. -2. When connecting an account either via the [frontend SDK](/connect/quickstart#use-the-pipedream-sdk-in-your-frontend), make sure to include the `oauthAppId` in `pd.connectAccount()`. -3. If using [Connect Link](/connect/quickstart#or-use-connect-link), make sure to include the `oauthAppId` in the URL. +2. When connecting an account either via the [frontend SDK](/managed-auth/connect/quickstart#use-the-pipedream-sdk-in-your-frontend), make sure to include the `oauthAppId` in `pd.connectAccount()`. +3. If using [Connect Link](/connect/managed-auth/quickstart#or-use-connect-link), make sure to include the `oauthAppId` in the URL. ### Finding your OAuth app ID diff --git a/docs-v2/pages/connect/managed-auth/webhooks.mdx b/docs-v2/pages/connect/managed-auth/webhooks.mdx index be9a4cb2394ae..29f82d93ca026 100644 --- a/docs-v2/pages/connect/managed-auth/webhooks.mdx +++ b/docs-v2/pages/connect/managed-auth/webhooks.mdx @@ -1,6 +1,6 @@ # Connect Webhooks -When you [generate a Connect token](/connect/quickstart/#generate-a-short-lived-token), you can pass a `webhook_uri` parameter. Pipedream will send a POST request to this URL when the user completes the connection flow, or if an error occurs at any point. [See the API docs](/connect/api#create-a-new-token) for details. +When you [generate a Connect token](/connect/managed-auth/quickstart/#generate-a-short-lived-token), you can pass a `webhook_uri` parameter. Pipedream will send a POST request to this URL when the user completes the connection flow, or if an error occurs at any point. [See the API docs](/connect/api#create-a-new-token) for details. ## Webhook events diff --git a/docs-v2/pages/connect/troubleshooting.mdx b/docs-v2/pages/connect/troubleshooting.mdx index 2c3791f450075..c3801caeef4ce 100644 --- a/docs-v2/pages/connect/troubleshooting.mdx +++ b/docs-v2/pages/connect/troubleshooting.mdx @@ -40,7 +40,7 @@ Connect tokens expire, and are only able to be used once. Try generating a new t >App not found. Please check your app id. -Double-check the app slug you're passing [when connecting your user's account](/connect/quickstart#connect-your-users-account). +Double-check the app slug you're passing [when connecting your user's account](/connect/managed-auth/quickstart#connect-your-users-account). ### Connection failed. Please retry or contact support. diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index 6cbccecd0a3b4..ac2ff4b7f7c70 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -71,7 +71,7 @@ When you trigger the workflow, Pipedream will look up the corresponding account To run an end-to-end test as an end user, you need to have users and connected accounts in your project. If you already have a **development** account linked, you can skip this step. -If you don't, the fastest way to do this is [on the **Users** tab](/connect#users) in your Pipedream project: +If you don't, the fastest way to do this is [on the **Users** tab](/connect/managed-auth/users) in your Pipedream project: - You'll see there's a button to **Connect account** - Go through the flow and make sure to create the account in **development** mode - Note the **external user ID** of the account you just connected, you'll need it in the next step @@ -242,7 +242,7 @@ We plan to improve this interface in the future, and potentially allow developer To test a step using the connected account of one of your end users in the builder, you'll need a few things to be configured so that your workflow knows which account to use. **Make sure you have an external user with the relevant connected account(s) saved to your project:** -- Go to the **[Users tab](/connect#users)** in the **Connect** section of your project to confirm +- Go to the **[Users tab](/connect/managed-auth/users)** in the **Connect** section of your project to confirm - If not, either connect one from your application or [directly in the UI](#connect-a-test-account) **Pass the environment and external user ID:** @@ -393,11 +393,11 @@ Pipedream Connect Error: Required account for hubspot not found for external use #### No matching external user ID - There was an external user ID passed, but it didn't match any users in the project. -- Double-check that the external user ID that you passed when invoking the workflow matches one either [in the UI](/connect#users) or [via the API](/connect/api#accounts). +- Double-check that the external user ID that you passed when invoking the workflow matches one either [in the UI](/connect/managed-auth/users) or [via the API](/connect/api#accounts). #### Required account not found for external user ID - The external user ID was passed when invoking the workflow, but the user doesn't have a connected account for one or more of the apps that are configured to use it in this workflow execution. -- You can check which connected accounts are available for that user [in the UI](/connect#users) or [via the API](/connect/api#accounts). +- You can check which connected accounts are available for that user [in the UI](/connect/managed-auth/users) or [via the API](/connect/api#accounts). #### Running workflows for your users in production requires a higher tier plan - Anyone is able to run workflows for your end users in `development`. The Business plan is required to run on behalf of `production` users. diff --git a/docs-v2/pages/rest-api/index.mdx b/docs-v2/pages/rest-api/index.mdx index efdf6723b0bf4..dbfe68cc1660c 100644 --- a/docs-v2/pages/rest-api/index.mdx +++ b/docs-v2/pages/rest-api/index.mdx @@ -189,7 +189,7 @@ You can find the app's ID in the response from the [List apps](#list-apps) endpo `oauth_app_id` **string** (_optional_) -The ID of the custom [OAuth app](/connect/quickstart#create-a-pipedream-oauth-client) you'd like to retrieve accounts for. +The ID of the custom [OAuth app](/connect/managed-auth/quickstart#create-a-pipedream-oauth-client) you'd like to retrieve accounts for. --- From 99e89f9ba3cc869b84ba48070f473309ba93c443 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 13:45:57 -0800 Subject: [PATCH 08/20] Fixing more broken links --- docs-v2/pages/connect/api-proxy.mdx | 2 +- docs-v2/pages/connect/managed-auth/oauth-clients.mdx | 2 +- docs-v2/vercel.json | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index bde1de5f2f561..7692380ff8e34 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -5,7 +5,7 @@ import Callout from '@/components/Callout' Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful in a few scenarios: -1. You need code-level control and you want to use [Pipedream's OAuth](/connect/managed-auth/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/managed-auth/oauth-clients#using-your-own-oauth-client) +1. You need code-level control and you want to use [Pipedream's OAuth](/connect/managed-auth/oauth-clients#using-pipedream-oauth) instead of [your own OAuth client](/connect/managed-auth/oauth-clients#using-a-custom-oauth-client) 2. There isn't a [pre-built tool](/connect/components) (action) for the app, or you need to modify the request 3. You want to avoid storing end user credentials in your app diff --git a/docs-v2/pages/connect/managed-auth/oauth-clients.mdx b/docs-v2/pages/connect/managed-auth/oauth-clients.mdx index d634442cec546..657dc1144823d 100644 --- a/docs-v2/pages/connect/managed-auth/oauth-clients.mdx +++ b/docs-v2/pages/connect/managed-auth/oauth-clients.mdx @@ -29,7 +29,7 @@ For any OAuth app that supports it, **you can always use your own client.** Your ## Using a custom OAuth client 1. Follow the steps [here](/connected-accounts/oauth-clients#configuring-custom-oauth-clients) to create an OAuth client in Pipedream. -2. When connecting an account either via the [frontend SDK](/managed-auth/connect/quickstart#use-the-pipedream-sdk-in-your-frontend), make sure to include the `oauthAppId` in `pd.connectAccount()`. +2. When connecting an account either via the [frontend SDK](/connect/managed-auth/quickstart#use-the-pipedream-sdk-in-your-frontend), make sure to include the `oauthAppId` in `pd.connectAccount()`. 3. If using [Connect Link](/connect/managed-auth/quickstart#or-use-connect-link), make sure to include the `oauthAppId` in the URL. ### Finding your OAuth app ID diff --git a/docs-v2/vercel.json b/docs-v2/vercel.json index 659e0f992a182..8d512d50050d3 100644 --- a/docs-v2/vercel.json +++ b/docs-v2/vercel.json @@ -313,6 +313,10 @@ { "source": "/docs/connect/webhooks", "destination": "/docs/connect/managed-auth/webhooks" + }, + { + "source": "/connect/oauth-clients#using-your-own-oauth-client", + "destination": "/connect/managed-auth/oauth-clients#using-a-custom-oauth-client" } ] } From 26df530f1012406ab8bf8016d7825bb146d8a907 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 14:39:38 -0800 Subject: [PATCH 09/20] Adding some links --- docs-v2/pages/connect/api-proxy.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 7692380ff8e34..646df26a596eb 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -27,10 +27,10 @@ Before getting started with the Connect proxy, make sure you've already gone thr You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sdk) with a fetch-style interface, or by making a request to the [REST API](/rest-api/connect/proxy). -- A Pipedream OAuth client to make authenticated requests to Pipedream's API # add a link -- The external user ID for your end user (ex, `abc-123`) # add link -- Connect environment (ex, `production` or `development`) # add link -- The account ID for your end user's connected account (ex, `apn_1234567`) # add a link to accounts endpoint +- A [Pipedream OAuth client](/rest-api/auth#oauth) to make authenticated requests to Pipedream's API +- The [external user ID](/connect/api#external-users) for your end user (ex, `abc-123`) +- Connect [environment](/connect/environments) (ex, `production` or `development`) +- The [account ID](docs/connect/api#accounts) for your end user's connected account (ex, `apn_1234567`) ### Code examples From bcc30d3f282edea50158bf4dff065de6ba8c1a34 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 14:49:18 -0800 Subject: [PATCH 10/20] small update to environments page --- docs-v2/pages/connect/environments.mdx | 2 +- pnpm-lock.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs-v2/pages/connect/environments.mdx b/docs-v2/pages/connect/environments.mdx index 8be50f4040661..6daf5b2b3162d 100644 --- a/docs-v2/pages/connect/environments.mdx +++ b/docs-v2/pages/connect/environments.mdx @@ -6,7 +6,7 @@ import Image from 'next/image' Pipedream Connect projects support two environments: `development` and `production`. Connected accounts and credentials stored in `development` remain separate from `production`. -Pipedream customers on any plan can use all of the Connect features in `development` mode. To use Connect in `production`, click **Contact Sales** [here](https://pipedream.com/pricing?plan=Enterprise) to get in touch with our team. +You can use all of the Connect features in `development` mode **on any plan**. **[Get in touch with our Sales team](https://pipedream.com/pricing?plan=Enterprise)** when you're ready to ship to production. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f8b36768e0be..548e38336130c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5690,8 +5690,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/klipy: - specifiers: {} + components/klipy: {} components/knack: dependencies: From f4f385925b03b8ad1fa1f1253d33548413dd5adb Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 15:04:38 -0800 Subject: [PATCH 11/20] Fixing bad link --- docs-v2/pages/connect/api-proxy.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 646df26a596eb..1595014bda73c 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -30,7 +30,7 @@ You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sd - A [Pipedream OAuth client](/rest-api/auth#oauth) to make authenticated requests to Pipedream's API - The [external user ID](/connect/api#external-users) for your end user (ex, `abc-123`) - Connect [environment](/connect/environments) (ex, `production` or `development`) -- The [account ID](docs/connect/api#accounts) for your end user's connected account (ex, `apn_1234567`) +- The [account ID](/connect/api#accounts) for your end user's connected account (ex, `apn_1234567`) ### Code examples From 708c073ce7500d2d4eeb8bfb960a14be0d0cda57 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Tue, 4 Feb 2025 21:56:46 -0800 Subject: [PATCH 12/20] Adding a couple visuals --- docs-v2/pages/connect/api-proxy.mdx | 14 ++++++-------- docs-v2/pages/connect/index.mdx | 2 ++ docs-v2/pages/connect/managed-auth/_meta.tsx | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 1595014bda73c..7457f4d798ac7 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -17,7 +17,7 @@ The Connect proxy enables you to interface with any integrated API and make auth - The proxy sends the request to the downstream API and dynamically inserts your end user's auth credentials - The proxy returns the response from the downstream API back to you -[include a diagram here] +![Connect API proxy visualization](https://res.cloudinary.com/pipedreamin/image/upload/v1738734958/pd-connect-proxy-viz_y8fzuk.png) Before getting started with the Connect proxy, make sure you've already gone through the [managed auth quickstart](/connect/managed-auth/quickstart) for Pipedream Connect. @@ -49,10 +49,8 @@ You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sd **Headers** -- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`). **This does not get forwarded to the downstream API.** -- Any other headers you include will be forwarded to the downstream API, with the exception of those with the `x-pd-` prefix -- For downstream API headers, don't prepend with anything, and we'll forward them as-is. For example: - +- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`) +- Only headers that contain the prefix `x-pd-proxy` will get forwarded to the downstream API @@ -69,15 +67,15 @@ const pd = createBackendClient({ }, }); -const url = "https://slack.com/api/chat.postMessage" -const options = { +const url = "https://slack.com/api/chat.postMessage" // No need to Base64 encode the URL if using the SDK +const params = { account_id: "{account_id}", // The account ID for your end user (ex, apn_1234567) external_user_id: "{external_user_id}", // The external user ID for your end user } const resp = await pd.makeProxyRequest( url, - options, + params, { method: "POST", body: { diff --git a/docs-v2/pages/connect/index.mdx b/docs-v2/pages/connect/index.mdx index d1e1a30733ec6..0f8746ffb1e7d 100644 --- a/docs-v2/pages/connect/index.mdx +++ b/docs-v2/pages/connect/index.mdx @@ -7,6 +7,8 @@ import VideoPlayer from "@/components/VideoPlayer"; **Connect provides a developer toolkit that lets you add {process.env.PUBLIC_APPS}+ integrations to your app or AI agent.** You can build AI agents, in-app messaging, CRM syncs, [and much more](/connect/use-cases), all in a few minutes. You have full, code-level control over how these integrations work in your app. You handle your product, Pipedream simplifies the integration. +![Connect visualization](https://res.cloudinary.com/pipedreamin/image/upload/v1738731467/pd-connect-viz_cep0uq.png) + ## Use managed auth - Handle authorization or accept API keys on behalf of your users, for any of Pipedream's [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) diff --git a/docs-v2/pages/connect/managed-auth/_meta.tsx b/docs-v2/pages/connect/managed-auth/_meta.tsx index fd1e8d5f42b21..98257d0a387af 100644 --- a/docs-v2/pages/connect/managed-auth/_meta.tsx +++ b/docs-v2/pages/connect/managed-auth/_meta.tsx @@ -2,9 +2,9 @@ export default { "index": "Overview", "users": "Users", "quickstart": "Quickstart", - "tokens": "Connect Tokens", - "connect-link": "Connect Link", - "oauth-clients": "OAuth Clients", + "tokens": "Connect tokens", + "connect-link": "Connect link", + "oauth-clients": "OAuth clients", "webhooks": "Webhooks", - "customization": "Customization", + "customization": "Customizing the auth flow", } as const From f975c25f94d1aebd555ceaa753f5fd476c6e9ec2 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 5 Feb 2025 20:35:16 -0800 Subject: [PATCH 13/20] pnpm-lock --- pnpm-lock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82e71c917d0f7..56806dc93707b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12789,7 +12789,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.6))(jiti@1.21.6)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -44937,7 +44937,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -44951,10 +44951,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.26.0 + '@babel/core': 8.0.0-alpha.13 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) + babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) esbuild: 0.24.2 ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): From c9cd1350a9d019b9600c98996c1e0f91deff310a Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 5 Feb 2025 20:55:19 -0800 Subject: [PATCH 14/20] more pnpm-lock --- pnpm-lock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 56806dc93707b..82e71c917d0f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12789,7 +12789,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.6))(jiti@1.21.6)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -44937,7 +44937,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -44951,10 +44951,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) esbuild: 0.24.2 ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): From b5ba6dc203d32564cfd9e45a61c0c7657de2b16b Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 5 Feb 2025 22:17:26 -0800 Subject: [PATCH 15/20] Updating API doc for proxy --- docs-v2/pages/connect/api-proxy.mdx | 92 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index 7457f4d798ac7..d5b7df7da61a3 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -13,11 +13,11 @@ Pipedream Connect provides a proxy API that you can use to send authenticated re The Connect proxy enables you to interface with any integrated API and make authenticated requests on behalf of your users, without dealing with OAuth or storing end user credentials. -- You send a request to the proxy and identify the end user you want to act on behalf of -- The proxy sends the request to the downstream API and dynamically inserts your end user's auth credentials -- The proxy returns the response from the downstream API back to you +1. You send a request to the proxy and identify the end user you want to act on behalf of +2. The proxy sends the request to the downstream API and dynamically inserts your end user's auth credentials +3. The proxy returns the response from the downstream API back to you -![Connect API proxy visualization](https://res.cloudinary.com/pipedreamin/image/upload/v1738734958/pd-connect-proxy-viz_y8fzuk.png) +![Connect API proxy visualization](https://res.cloudinary.com/pipedreamin/image/upload/v1738822030/pd-connect-proxy-viz_k5iksb.png) Before getting started with the Connect proxy, make sure you've already gone through the [managed auth quickstart](/connect/managed-auth/quickstart) for Pipedream Connect. @@ -28,33 +28,16 @@ Before getting started with the Connect proxy, make sure you've already gone thr You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sdk) with a fetch-style interface, or by making a request to the [REST API](/rest-api/connect/proxy). - A [Pipedream OAuth client](/rest-api/auth#oauth) to make authenticated requests to Pipedream's API -- The [external user ID](/connect/api#external-users) for your end user (ex, `abc-123`) - Connect [environment](/connect/environments) (ex, `production` or `development`) +- The [external user ID](/connect/api#external-users) for your end user (ex, `abc-123`) - The [account ID](/connect/api#accounts) for your end user's connected account (ex, `apn_1234567`) -### Code examples - -**URL** - -- The URL of the API you want to call (ex, `https://slack.com/api/chat.postMessage`) -- If using the REST API, this should be an URL-safe Base64 encoded string (ex, `aHR0cHM6Ly9zbGFjay5jb20vYXBpL2NoYXQucG9zdE1lc3NhZ2U`) +Refer to the full Connect API [here](/connect/api). -**HTTP method** +### Using the Pipedream SDK (preferred) -- Use the HTTP method required by the downstream API - -**Body** +You can use the [Pipedream SDK](https://www.npmjs.com/package/@pipedream/sdk) to send a fetch-style request: -- Optionally include a body to send to the downstream API - -**Headers** - -- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`) -- Only headers that contain the prefix `x-pd-proxy` will get forwarded to the downstream API - - - - ```javascript import { createBackendClient } from "@pipedream/sdk/server"; @@ -67,29 +50,55 @@ const pd = createBackendClient({ }, }); -const url = "https://slack.com/api/chat.postMessage" // No need to Base64 encode the URL if using the SDK -const params = { - account_id: "{account_id}", // The account ID for your end user (ex, apn_1234567) - external_user_id: "{external_user_id}", // The external user ID for your end user -} const resp = await pd.makeProxyRequest( - url, - params, { - method: "POST", - body: { - text: "hello, world", - channel: "C03NA8B4VA9" + searchParams: { + account_id: "{account_id}", // The account ID for your end user (ex, apn_1234567) + external_user_id: "{external_user_id}", // The external user ID for your end user + } }, -}) + { + url: "https://slack.com/api/chat.postMessage", // Include any query params you need; no need to Base64 encode the URL if using the SDK + options: { + method: "POST", + headers: { + hello: "world!" // These get sent to the downstream API + }, + body: { + text: "hello, world", + channel: "C03NA8B4VA9" + }, + }, + } +) // Parse and return the data you need console.log(resp); ``` - - +### Using the REST API + +You can also send a request to the Connect REST API with the below config: + +**URL** + +- The URL of the API you want to call (ex, `https://slack.com/api/chat.postMessage`) +- When using the REST API, this should be an URL-safe Base64 encoded string (ex, `aHR0cHM6Ly9zbGFjay5jb20vYXBpL2NoYXQucG9zdE1lc3NhZ2U`) + +**HTTP method** + +- Use the HTTP method required by the downstream API + +**Body** + +- Optionally include a body to send to the downstream API + +**Headers** + +- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`) +- Headers that contain the prefix `x-pd-proxy` will get forwarded to the downstream API + ```bash # First, obtain an OAuth access token curl -X POST https://api.pipedream.com/v1/oauth/token \ @@ -111,7 +120,4 @@ curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/proxy/{url_ }' # Parse and return the data you need -``` - - - \ No newline at end of file +``` \ No newline at end of file From b31687060e47a04bacc5eefa9d3a4d4fa7d5f774 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 6 Feb 2025 09:09:00 -0800 Subject: [PATCH 16/20] More updates --- docs-v2/pages/connect/managed-auth/_meta.tsx | 11 +++++------ docs-v2/pages/connect/managed-auth/customization.mdx | 2 +- docs-v2/pages/connect/managed-auth/index.mdx | 0 docs-v2/pages/connect/managed-auth/tokens.mdx | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 docs-v2/pages/connect/managed-auth/index.mdx diff --git a/docs-v2/pages/connect/managed-auth/_meta.tsx b/docs-v2/pages/connect/managed-auth/_meta.tsx index 98257d0a387af..692e9c6c53693 100644 --- a/docs-v2/pages/connect/managed-auth/_meta.tsx +++ b/docs-v2/pages/connect/managed-auth/_meta.tsx @@ -1,10 +1,9 @@ export default { - "index": "Overview", - "users": "Users", "quickstart": "Quickstart", - "tokens": "Connect tokens", - "connect-link": "Connect link", - "oauth-clients": "OAuth clients", + "users": "Users", + "tokens": "Connect Tokens", + "connect-link": "Connect Link", + "oauth-clients": "OAuth Clients", "webhooks": "Webhooks", - "customization": "Customizing the auth flow", + "customization": "Customizing the Auth Flow", } as const diff --git a/docs-v2/pages/connect/managed-auth/customization.mdx b/docs-v2/pages/connect/managed-auth/customization.mdx index 4443ad14f1cb8..b4f842cf3f0c8 100644 --- a/docs-v2/pages/connect/managed-auth/customization.mdx +++ b/docs-v2/pages/connect/managed-auth/customization.mdx @@ -1,7 +1,7 @@ import ArcadeEmbed from '@/components/ArcadeEmbed' import Callout from '@/components/Callout' -# Customizing Your Application +# Customizing the Auth Flow Date: Thu, 6 Feb 2025 09:12:20 -0800 Subject: [PATCH 17/20] connect proxy title --- docs-v2/pages/connect/api-proxy.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-v2/pages/connect/api-proxy.mdx b/docs-v2/pages/connect/api-proxy.mdx index d5b7df7da61a3..654aeba7a5c04 100644 --- a/docs-v2/pages/connect/api-proxy.mdx +++ b/docs-v2/pages/connect/api-proxy.mdx @@ -1,7 +1,7 @@ import { Tabs } from 'nextra/components' import Callout from '@/components/Callout' -# Connect Proxy +# Connect API Proxy Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users, which is useful in a few scenarios: From bacb102e974a74573885a13d874fa177b43b50ac Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 6 Feb 2025 09:31:58 -0800 Subject: [PATCH 18/20] Adding ref to demo app --- docs-v2/pages/connect/components.mdx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs-v2/pages/connect/components.mdx b/docs-v2/pages/connect/components.mdx index 115ca6067a670..e8b8d0b8bf4a2 100644 --- a/docs-v2/pages/connect/components.mdx +++ b/docs-v2/pages/connect/components.mdx @@ -13,10 +13,21 @@ In Pipedream, we call triggers and actions [components](/components), which are result that's exported as output. These components are developed and maintained by Pipedream and our community and their source code is available in our [public Github repo](https://github.com/PipedreamHQ/pipedream/tree/master/components). +## Implementation + +### Use Pipedream's frontend React SDK +- Pipedream provides an SDK that you can use to automatically render React UI components in your application to enable your users to configure and run the triggers and actions +- Style the UI components however you want to match the design of your app, and you can also fork the SDK +- Refer to the [SDK](https://github.com/PipedreamHQ/pipedream/blob/master/packages/connect-react/README.md) to get started + -This feature is in **beta**, and we're looking for feedback. Please [let us know](https://pipedream.com/support) how you're using it, what's not working, and what else you'd like to see. +Check out the [public demo app](https://pdrm.co/connect) to see the API and SDK in action. You can also [run it locally and explore the code](https://github.com/PipedreamHQ/pipedream-connect-examples/tree/master/connect-react-demo). +### Use your own frontend +- See below to get started with the REST API +- Refer to the [full API reference](/connect/api#components) for supported SDK methods as well + ## Getting started From 34a7510c7250506b8fbeaf82e456ebe11c17c682 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 6 Feb 2025 10:21:46 -0800 Subject: [PATCH 19/20] pnpm-lock --- pnpm-lock.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74e2588af2eb8..4b569e3cc0e53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32201,6 +32201,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: From e6be104f2e0b1a8c0646cc57989e82c319e3128e Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 6 Feb 2025 10:27:25 -0800 Subject: [PATCH 20/20] tweaking language for connect-react sdk --- docs-v2/pages/connect/components.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/connect/components.mdx b/docs-v2/pages/connect/components.mdx index e8b8d0b8bf4a2..a8f2d0c7a8cb6 100644 --- a/docs-v2/pages/connect/components.mdx +++ b/docs-v2/pages/connect/components.mdx @@ -15,8 +15,8 @@ and our community and their source code is available in our [public Github repo] ## Implementation -### Use Pipedream's frontend React SDK -- Pipedream provides an SDK that you can use to automatically render React UI components in your application to enable your users to configure and run the triggers and actions +### Use Pipedream's frontend SDK +- Pipedream provides a frontend React SDK to enable your users to configure and run triggers and actions in your app's UI - Style the UI components however you want to match the design of your app, and you can also fork the SDK - Refer to the [SDK](https://github.com/PipedreamHQ/pipedream/blob/master/packages/connect-react/README.md) to get started