Skip to content

Commit

Permalink
Adding info re: OAuth clients to Connect docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyroosevelt committed Oct 29, 2024
1 parent 0a12942 commit 1e2ef10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs-v2/pages/connect/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"environments": {
"title": "Environments"
},
"oauth-clients": {
"title": "OAuth Clients"
},
"webhooks": {
"title": "Webhooks"
},
Expand Down
18 changes: 18 additions & 0 deletions docs-v2/pages/connect/oauth-clients.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Image from 'next/image'

# 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 quick get up and running. [Read more about OAuth clients in Pipedream here](/connected-accounts/oauth-clients).

## Using a custom OAuth client
1. Follow the steps outlined [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 the 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) or using [Connect Link](/connect/quickstart#use-connect-link), make sure to include the `oauth_app_id` in the request.

## 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.

<Image src="https://res.cloudinary.com/pipedreamin/image/upload/v1730241292/oauth-app-id_umhhqi.png" alt="Copy OAuth App ID" width={650} height={529} />

## Using Pipedream OAuth clients
5 changes: 3 additions & 2 deletions docs-v2/pages/connect/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export default function Home() {
const pd = createClient()
function connectAccount() {
pd.connectAccount({
app: process.env.NEXT_PUBLIC_PIPEDREAM_APP_SLUG, // From the Next.js example — adjust to pass your own app name slug
app: appSlug, // Pass the app name slug of the app you want to integrate
oauthAppId: appId, // For OAuth apps, pass the OAuth app ID; omit this param to use Pipedream's OAuth client or for key-based apps
token: "YOUR_TOKEN", // The token you received from your server above
onSuccess: ({ id: accountId }) => {
console.log(`Account successfully connected: ${accountId}`)
Expand Down Expand Up @@ -168,7 +169,7 @@ The Connect Link opens a Pipedream-hosted page, guiding users through the accoun
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}
https://pipedream.com/_static/connect.html?token={token}&connectLink=true&app={appSlug}&oauthAppId={oauthAppId}
```

4. Redirect your users to this URL, or send it to them via email, SMS, and more.
Expand Down

0 comments on commit 1e2ef10

Please sign in to comment.