-
Couldn't load subscription status.
- Fork 5.5k
cherry picked changes from new docs #14473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Connect Link | ||
|
|
||
| Connect Link provides a Pipedream-hosted link that lets you connect third-party accounts without any frontend implementation in your app. | ||
|
|
||
| ## When to use Connect Link | ||
|
|
||
| If you aren't able to execute JavaScript or open an iFrame in your frontend, or you want to send users a URL to connect accounts via email or SMS, use Connect Link. That URL opens a Pipedream-hosted page that guides the user through the account connection flow. The URL is scoped to the specific end user, and expires after 4 hours. | ||
|
|
||
| ## How to generate a link | ||
|
|
||
| See [the Connect quickstart](/connect/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-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: | ||
|
|
||
| ``` | ||
| https://pipedream.com/_static/connect.html?token={token}&connectLink=true&app={appSlug} | ||
| ``` | ||
|
|
||
| 4. Redirect your users to this URL, or send it to them via email, SMS, and more. | ||
|
|
||
| **To test this code, check out this workflow:** | ||
| [https://pipedream.com/new?h=tch_EvfbvQ](https://pipedream.com/new?h=tch_EvfbvQ) | ||
|
|
||
| ## Success and error redirect URLs | ||
|
|
||
| When you [generate a Connect link](/connect/quickstart/#how-to-generate-a-link), you can specify `success_redirect_url` and `error_redirect_url` parameters. Pipedream will redirect the end user to these URLs after they complete the connection flow, or if an error occurs. [See the API docs](/connect/api#create-a-new-token) for details. | ||
|
|
||
| In the absence of these URLs, Pipedream will redirect the user to a Pipedream-hosted success or error page at the end of the connection flow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Environments | ||
|
|
||
| Pipedream Connect projects support two environments: `development` and `production`. | ||
|
|
||
| 1. Connected accounts and credentials stored in `development` remain separate from `production`. | ||
| 2. In `development`, you can use the official Pipedream OAuth apps, so you can test integrations without creating your own OAuth client. | ||
|
|
||
| ## How to specify environment | ||
|
|
||
| You specify the environment when [creating a new Connect token](/connect/api/#create-a-new-token) with the Pipedream SDK or API. By default, the enviromment is set to `production`. When users succesfully connect their account, Pipedream saves it for that `external_user_id` in the specified `project_environment`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import Image from 'next/image' | ||
| import Callout from '@/components/Callout' | ||
|
|
||
| # OAuth Clients | ||
|
|
||
| When connecting an account for any OAuth app via Pipedream Connect, we'll default to using Pipedream's official OAuth client, which enables you to quickly get up and running. [Read more about OAuth clients in Pipedream here](/connected-accounts/oauth-clients). | ||
|
|
||
| ## Using Pipedream OAuth | ||
|
|
||
| There are two types of apps in Pipedream: | ||
|
|
||
| 1. **Key-based**: These apps require static credentials, like API keys. Pipedream stores these credentials securely and exposes them via API. | ||
| 2. **OAuth**: These apps require OAuth authorization. Pipedream manages the OAuth flow for these apps, ensuring you always have a fresh access token for requests. | ||
|
|
||
| **OAuth apps require you create your own OAuth client to [deploy to production](/connect/environments):** | ||
|
|
||
| <Callout type="info"> | ||
| To get started in [development mode](/connect/environments), you can skip these steps. To deploy your app to production, you'll need to [create an OAuth client](#using-a-custom-oauth-client) for the app you're integrating. | ||
| </Callout> | ||
|
|
||
| ## 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. Open the **Apps** tab within your Pipedream project and select **Add app**. | ||
| 3. Select the app you're looking for, then select your OAuth client from the dropdown menu. | ||
| 4. When connecting an account either via the [frontend SDK](/connect/quickstart#use-the-pipedream-sdk-in-your-frontend), make sure to include the `oauth_app_id` in `pd.connectAccount()`. | ||
| 5. If using [Connect Link](/connect/quickstart#use-connect-link), make sure to include the `oauth_app_id` in the URL. | ||
|
|
||
| ### Finding your OAuth app ID | ||
|
|
||
| [Create your OAuth client in Pipedream](https://pipedream.com/@/accounts/oauth-clients) then click the arrow to the left of the client name to expand the details. | ||
|
|
||
| <br /> | ||
|
|
||
| <Image src="https://res.cloudinary.com/pipedreamin/image/upload/v1730241292/oauth-app-id_umhhqi.png" alt="Copy OAuth App ID" width={650} height={529} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Connect tokens | ||
|
|
||
| When you initiate account connection for your end users, you must either: | ||
|
|
||
| 1. Generate a secure, short-lived token scoped to the end user, or | ||
| 2. Use the [Connect Link](/connect/connect-link) feature to generate a URL that guides the user through the account connection flow without any frontend work on your side. | ||
|
|
||
| Here, we'll show you how to generate tokens for your users and return that to your frontend, passing that to the account connection flow. | ||
|
|
||
| Use tokens when you want to handle the account connection flow yourself, in your app's UI. For example, you might want to show a **Connect Slack** button in your app that triggers the account connection flow for Slack, or launch the flow in a modal. | ||
|
|
||
| ## Creating a token | ||
|
|
||
| See docs on [the `/tokens` endpoint](/connect/api/#create-a-new-token) to create new tokens. | ||
|
|
||
| ## Webhooks | ||
|
|
||
| When you generate a token, you can specify a `webhook_uri` where Pipedream will deliver updates on the account connection flow. This is useful if you want to update your UI based on the status of the account connection flow, get a log of errors, and more. | ||
|
|
||
| [See the webhooks docs](/connect/webhooks) for more information. | ||
|
|
||
| ## Tokens are scoped to end users and project environments | ||
|
|
||
| When you [create a new Connect token](/connect/api/#create-a-new-token), you pass an `external_user_id` and an optional `project_environment` parameter. By default, the environment is set to `production`. Available environments include: | ||
| - `production` (default) | ||
| - `development` | ||
|
|
||
| Tokens are scoped to this user and environment. When the user successfully connects an account with that token, it will be saved for that `external_user_id` in the specified `project_environment`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Connect Webhooks | ||
|
|
||
| When you [generate a Connect token](/connect/quickstart/#generate-a-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 | ||
|
|
||
| - `CONNECTION_SUCCESS` - Sent when the user successfully connects their account | ||
| - `CONNECTION_ERROR` - Sent when an error occurs during the connection flow | ||
dannyroosevelt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Webhook payload | ||
|
|
||
| ### Successful connection | ||
|
|
||
| Please note that user credentials are not sent in the webhook request. To retrieve credentials, use the [Connect API to fetch the account](/connect/api#retrieve-account-details-by-id) using the `account.id` provided in the webhook payload. | ||
|
|
||
| ```json | ||
| { | ||
| "event": "CONNECTION_SUCCESS", | ||
| "connect_token": "abc123", | ||
| "environment": "production", | ||
| "connect_session_id": 123, | ||
| "account": { | ||
| "id": "apn_abc123", | ||
| "name": "My Slack workspace", | ||
| "external_id": "U123456", | ||
| "healthy": true, | ||
| "dead": false, | ||
| "app": { | ||
| "id": "app_abc123", | ||
| "name_slug": "slack", | ||
| "name": "Slack", | ||
| "auth_type": "oauth", | ||
| "description": "Slack is a channel-based messaging platform", | ||
| "img_src": "https://assets.pipedream.net/icons/slack.svg", | ||
| "custom_fields_json": [], | ||
| "categories": "Communication", | ||
| }, | ||
| "created_at": "2021-09-01T00:00:00Z", | ||
| "updated_at": "2021-09-01T00:00:00Z", | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Error | ||
|
|
||
| ```json | ||
| { | ||
| "event": "CONNECTION_ERROR", | ||
| "connect_token": "abc123", | ||
| "environment": "production", | ||
| "connect_session_id": 123, | ||
| "error": "You've hit your limit on the number of external users you can connect." | ||
| } | ||
| ``` | ||
dannyroosevelt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.