From 089a0235940ecda4231ea5cc06956eddca8e4004 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Wed, 15 Jan 2025 10:46:09 -0800 Subject: [PATCH 1/4] Small updates to Connect docs --- docs-v2/next.config.mjs | 3 +++ docs-v2/pages/_meta.tsx | 6 +++--- docs-v2/pages/connect/_meta.tsx | 2 +- docs-v2/pages/connect/components.mdx | 4 ++-- docs-v2/pages/connect/index.mdx | 14 +++++++------- docs-v2/pages/connect/quickstart.mdx | 2 +- docs-v2/pages/connect/workflows.mdx | 8 ++++---- docs-v2/pages/index.mdx | 5 +++-- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/docs-v2/next.config.mjs b/docs-v2/next.config.mjs index da1cca2c0364b..99c7af289d5ba 100644 --- a/docs-v2/next.config.mjs +++ b/docs-v2/next.config.mjs @@ -51,6 +51,9 @@ export default withNextra({ 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", + REGISTRY_ACTIONS: "5,300", + REGISTRY_SOURCES: "2,500", + REGISTRY_COMPONENTS: "8,000", FREE_INSPECTOR_EVENT_LIMIT: "7 days of events", WARM_WORKERS_INTERVAL: "10 minutes", WARM_WORKERS_CREDITS_PER_INTERVAL: "5", diff --git a/docs-v2/pages/_meta.tsx b/docs-v2/pages/_meta.tsx index cbab283cabf28..4a817bb34cdb3 100644 --- a/docs-v2/pages/_meta.tsx +++ b/docs-v2/pages/_meta.tsx @@ -4,14 +4,14 @@ export default { "workspaces": "Workspaces", "projects": "Projects", "workflows": "Workflows", + "connect": { + title: "Pipedream Connect", + }, "code": "Code", "data-stores": "Data Stores", "databases": "Databases", "connected-accounts": "Connected Accounts", "apps": "Integrations", - "connect": { - title: "Pipedream Connect", - }, "components": "Components", "sources": "Sources", "event-history": "Event History", diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index 8092943c9234b..1ba883bb056b5 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -12,7 +12,7 @@ export default { "title": "Running workflows", }, "components": { - "title": "Running components", + "title": "Embedding components", }, "api": { "title": "API & SDK reference", diff --git a/docs-v2/pages/connect/components.mdx b/docs-v2/pages/connect/components.mdx index d985dad9d5192..1be6ec5f0c3dd 100644 --- a/docs-v2/pages/connect/components.mdx +++ b/docs-v2/pages/connect/components.mdx @@ -1,10 +1,10 @@ import { Steps, Tabs } from 'nextra/components' import Callout from '@/components/Callout' -# Running components for your end users +# Embedding components in your application Pipedream Connect provides APIs to embed [pre-built components](/components) directly in your application -or AI agent, unlocking access to thousands of pre-built API operations. Enable [your end users](/connect/api#external-users) to +or AI agent, unlocking access to {process.env.REGISTRY_COMPONENTS}+ pre-built 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? diff --git a/docs-v2/pages/connect/index.mdx b/docs-v2/pages/connect/index.mdx index 09cb3c5675242..7bd457ea0b63b 100644 --- a/docs-v2/pages/connect/index.mdx +++ b/docs-v2/pages/connect/index.mdx @@ -12,9 +12,9 @@ You have full, code-level control over how these integrations work in your app. Connect lets you: 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. [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. -4. [Embed any Pipedream action or trigger](/connect/components) to run on behalf of your users, directly from within your application. +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.
@@ -33,13 +33,13 @@ Pipedream Connect lets you build any API integration into your product in minute ## Getting started -Watch [the demo](https://www.youtube.com/embed/xhUagMsogkQ) or visit [the quickstart](/connect/quickstart) to build your first integration. +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 official OAuth client. To deploy your integrations to production, you'll need to configure your own OAuth client. Read more about OAuth clients in Pipedream [here](/connected-accounts/oauth-clients). +By default, apps that use OAuth to authenticate will use Pipedream's OAuth client. Depending on your use case, you maye 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). @@ -47,14 +47,14 @@ By default, apps that use OAuth to authenticate will use Pipedream's official OA To view or delete your users' connected accounts: -1. Open your project +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. +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. diff --git a/docs-v2/pages/connect/quickstart.mdx b/docs-v2/pages/connect/quickstart.mdx index 10ada37868013..8e2fc1d773bfd 100644 --- a/docs-v2/pages/connect/quickstart.mdx +++ b/docs-v2/pages/connect/quickstart.mdx @@ -57,7 +57,7 @@ If you're building your own app, you'll need to provide these values to the envi ### Create a project in Pipedream -1. Open an existing Pipedream project or create a new one at [https://pipedream.com/projects](https://pipedream.com/projects). +1. Open an existing Pipedream project or create a new one at [pipedream.com/projects](https://pipedream.com/projects). 2. Click the **Settings** tab, then copy your **Project ID**. ### Create a Pipedream OAuth client diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index 6026c6c51a7b6..cf378feded3dc 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -7,7 +7,7 @@ import Image from 'next/image' Just like you can build and run internal [workflows](/workflows/) for your team, **you can run workflows for [your end users](/connect/api#external-users), too**. -Whether you're building well-defined integrations or more-autonomous AI agents, workflows provide a powerful set of tools for running [code](/code) or [pre-defined actions](/workflows/actions) on behalf of your users. Pipedream's UI makes it easy to build, test, and [debug](/workflows/inspect) workflows. +Whether you're building well-defined integrations or autonomous AI agents, workflows provide a powerful set of tools for running [code](/code) or [pre-defined actions](/workflows/actions) on behalf of your users. Pipedream's UI makes it easy to build, test, and [debug](/workflows/inspect) workflows. ## What are workflows? @@ -44,9 +44,7 @@ Read [the quickstart](/quickstart/) to learn more. 2. [Configure **OAuth** authorization](/workflows/triggers#oauth) on the trigger. -To securely run workflows for end users, **configuring OAuth authorization on the trigger is optional but strongly recommended.** - -[Create a Pipedream OAuth client](/rest-api/auth#creating-an-oauth-client) to authenticate requests to the Pipedream API and workflows. +To securely run workflows for end users, **configuring OAuth authorization on the trigger is optional but strongly recommended.** [Create a Pipedream OAuth client](/rest-api/auth#creating-an-oauth-client) to authenticate requests to the Pipedream API and workflows. ### Configure accounts to use your end users' auth @@ -235,6 +233,8 @@ curl -X POST https://{your-endpoint-url} \ We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime. + +[Let us know](https://pipedream.com/support) if that's a feature you'd like to see. ## Testing workflow steps diff --git a/docs-v2/pages/index.mdx b/docs-v2/pages/index.mdx index edbad5617b1d3..ed74056c48bc4 100644 --- a/docs-v2/pages/index.mdx +++ b/docs-v2/pages/index.mdx @@ -2,12 +2,13 @@ import VideoPlayer from "@/components/VideoPlayer"; # Introduction to Pipedream -Pipedream is the fastest way to automate any process that connects APIs. Build and run workflows with code-level control when you need it, and no code when you don't. +Pipedream is the fastest way to automate any process that connects APIs. Build and run workflows with code-level control when you need it, and no code when you don't. Easily add thousands of customer-facing integrations to your app or AI agent in minutes. The Pipedream platform includes: - A [serverless runtime](/code/) and [workflow service](/workflows/) -- Source-available [triggers](/workflows/steps/triggers/) and [actions](/workflows/steps/actions/) for [hundreds of integrated apps](https://pipedream.com/explore/) +- SDK to handle [customer authentication](/connect/) for {process.env.PUBLIC_APPS}+ APIs +- Source-available pre-built [triggers](/workflows/steps/triggers/) and [actions](/workflows/steps/actions/) for [thousands of integrated apps](https://pipedream.com/explore/) - One-click [OAuth and key-based authentication](/connected-accounts/) for more than {process.env.PUBLIC_APPS} APIs (use tokens directly in code or with pre-built actions) Watch a demo or review our [quickstart guide](/quickstart/): From 224943dff6187254473c6e16602d0ee54086d57f Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 16 Jan 2025 12:31:44 -0800 Subject: [PATCH 2/4] Adding allowed_origins to createConnectToken docs --- docs-v2/pages/connect/api.mdx | 19 ++++++++++++++++++- docs-v2/pages/connect/workflows.mdx | 4 +--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs-v2/pages/connect/api.mdx b/docs-v2/pages/connect/api.mdx index 28622afc0f609..982c56cece62f 100644 --- a/docs-v2/pages/connect/api.mdx +++ b/docs-v2/pages/connect/api.mdx @@ -181,6 +181,17 @@ The ID of your end user. Use whatever ID uniquely identifies the user in your sy --- +`allowed_origins` **string array** + +When using the Connect API to make requests from a client environment like a browser, you must specify the allowed origins for the token. Otherwise, this field is optional. This is a list of URLs that are allowed to make requests with the token. For example: + +```json +{ + "allowed_origins": ["http://localhost:3000", "https://example.com"] +} +``` +--- + `success_redirect_uri` **string** (_optional_) When using [Connect Link](/connect/connect-link), you can optionally redirect your end user to the `success_redirect_uri` on successful completion of the auth flow. @@ -224,6 +235,7 @@ const pd = createBackendClient({ const { token, expires_at } = await pd.createConnectToken({ external_user_id: "{your_external_user_id}" // The end user's ID in your system + allowed_origins: ["http://localhost:3000", "https://example.com"], // The allowed origins for the token (required for client-side requests) }); ``` @@ -242,6 +254,7 @@ const pd = createBackendClient({ const { token, expires_at } = await pd.createConnectToken({ external_user_id: "{your_external_user_id}", // The end user's ID in your system + allowed_origins: ["http://localhost:3000", "https://example.com"], // The allowed origins for the token (required for client-side requests) }); ``` @@ -263,7 +276,11 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/tokens \ -H "X-PD-Environment: development" \ -H "Authorization: Bearer {access_token}" \ -d '{ - "external_user_id": "{your_external_user_id}" + "external_user_id": "{your_external_user_id}", + "allowed_origins": [ + "http://localhost:3000", + "https://example.com" + ], }' ``` diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index cf378feded3dc..167cb4261d765 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -232,9 +232,7 @@ curl -X POST https://{your-endpoint-url} \ -We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime. - -[Let us know](https://pipedream.com/support) if that's a feature you'd like to see. +We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime. [Let us know](https://pipedream.com/support) if that's a feature you'd like to see. ## Testing workflow steps From 9c4723979d5b579ab48f64b03ac78e4f5d0ff088 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 24 Jan 2025 14:23:13 -0800 Subject: [PATCH 3/4] adding info on dev rate limits --- docs-v2/pages/connect/api.mdx | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/docs-v2/pages/connect/api.mdx b/docs-v2/pages/connect/api.mdx index 982c56cece62f..b83cc11669860 100644 --- a/docs-v2/pages/connect/api.mdx +++ b/docs-v2/pages/connect/api.mdx @@ -142,6 +142,8 @@ External User IDs are limited to 250 characters. ## Rate limits +### Pipedream rate limits + | API Endpoint | Rate Limit | |----------------------------|------------------------------------------------------| | `POST /tokens` | 100 requests per minute per `external_user_id` | @@ -149,6 +151,84 @@ External User IDs are limited to 250 characters. If you need higher rate limits, please [reach out](https://pipedream.com/support). +### Developer rate limits + +- You can optionally set rate limits for your users to control their usage of the Connect API from within your application, to prevent runaway use or abuse. +- Specify a time window in seconds and how many requests to allow in that window. The API will give you a `rate_limit_token` that you'll need to include in future `/connect/` requests: + +``` +POST /rate_limits +``` + +**Body parameters** + +`window_size_seconds` **integer** + +Define the size of the time window in seconds. + +--- + +`requests_per_window` **integer** + +Define the number of requests you want to allow per time window. + +**Example request** + +```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. +# Define the rate limit parameters + +curl -X POST https://api.pipedream.com/v1/connect/rate_limits \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer {access_token}" \ + -d '{ + "window_size_seconds": 10, + "requests_per_window": 1000 + }' +``` + +**Example response** +```json +{ + "token": "CiKpqRdTmNwLfhzSvYxBjAkMnVbXuQrWeZyHgPtJsDcEvFpLnE" +} +``` + +**Example usage** + +``` +# The response will include a rate limit token. Pass it as a header in your downstream requests to the Connect API. +# Below is an example request that runs the "List Commits" action for the Gitlab app. + +echo '{ + "external_user_id": "jverce", + "id": "gitlab-list-commits", + "configured_props": { + "gitlab": { + "authProvisionId": "apn_kVh9AoD" + }, + "projectId": 45672541, + "refName": "main" + } +}' > data.json + +curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/actions/run" \ + -H "Authorization: Bearer {access_token}" \ + -H "Content-Type: application/json" \ + -H "x-pd-rate-limit: {rate_limit_token}" \ # Pass the rate limit token in the header + -d @data.json +' +``` + ## API Reference ### Invoke workflows From bd1664af55f01e42723a741f3f18f5ceb6568077 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 24 Jan 2025 14:24:03 -0800 Subject: [PATCH 4/4] Update pnpm-lock.yaml --- pnpm-lock.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a3548f76a3d2e..16f67c0753ef1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8294,8 +8294,7 @@ importers: components/propeller: {} - components/proposify: - specifiers: {} + components/proposify: {} components/proprofs_quiz_maker: {}