import Callout from '@/components/Callout' import { Steps } from 'nextra/components' import Image from 'next/image' import VideoPlayer from "@/components/VideoPlayer" import { GlobalConnectProvider } from '@/components/GlobalConnectProvider' import TokenGenerationDemo from '@/components/TokenGenerationDemo' import AccountConnectionDemo from '@/components/AccountConnectionDemo' import ConnectLinkDemo from '@/components/ConnectLinkDemo'
Pipedream Connect is the easiest way for your users to connect to over {process.env.PUBLIC_APPS}+ APIs, right in your product. You can build in-app messaging, CRM syncs, AI agents, and much more, all in a few minutes.
Here's a high-level overview of how Connect works with your app:
Here's how Connect sits in your frontend and backend, and communicates with Pipedream's API:
We'll walk through these steps below with an interactive demo that lets you see an execute the code directly in the docs.
You'll need to do two things to add Pipedream Connect to your app:
- Connect to the Pipedream API from your server. This lets you make secure calls to the Pipedream API to initiate the account connection flow and retrieve account credentials.
- Add the Pipedream SDK to your frontend or redirect your users to a Pipedream-hosted URL to start the account connection flow.
If you're building your own app, you'll need to provide these credentials to the environment, or retrieve them from your secrets store:
# Used to authorize requests to the Pipedream API
PIPEDREAM_CLIENT_ID=your_client_id
PIPEDREAM_CLIENT_SECRET=your_client_secret
PIPEDREAM_ENVIRONMENT=development
PIPEDREAM_PROJECT_ID=your_project_id
- Open an existing Pipedream project or create a new one at pipedream.com/projects
- Click the Settings tab, then copy your Project ID
Pipedream uses OAuth to authorize requests to the REST API. To create an OAuth client:
- Visit the API settings for your workspace
- Create a new OAuth client and note the client ID and secret
You'll need these when configuring the SDK and making API requests.
To securely initiate account connections for your users, you'll need to generate a short-lived token for your users and use that in the account connection flow. See the docs on Connect tokens for a general overview of why we need to create tokens and scope them to end users.
Check out the code below try it yourself:
Once you have a token, return it to your frontend to start the account connection flow for the user, or redirect them to a Pipedream-hosted URL with Connect Link.
Refer to the API docs for [full set of parameters you can pass](/connect/api/#create-token) in the `ConnectTokenCreate` call.You have two options when connecting an account for your user:
- Use the Pipedream SDK in your frontend
- Use Connect Link to deliver a hosted URL to your user
Use this method when you want to handle the account connection flow yourself, in your app. For example, you might want to show a Connect Slack button in your app that triggers the account connection flow.
First, install the Pipedream SDK in your frontend:
npm i --save @pipedream/sdk
When the user connects an account in your product, pass the token from your backend and call connectAccount
. This opens a Pipedream iFrame that guides the user through the account connection.
Try the interactive demo below to connect an account after generating a token in the previous step:
Use this option when you can't execute JavaScript or open an iFrame in your environment (e.g. mobile apps) and instead want to share a URL with your end users.
The Connect Link URL opens a Pipedream-hosted page, guiding users through the account connection process. The URL is specific to the user and expires after 4 hours.
After generating a token in the step above, you can use the resulting Connect Link URL. Try it below:
Check out the full API docs for all parameters you can pass when creating tokens, including setting redirect URLs for success or error cases.
Now that your users have connected an account, you can use their auth in one of a few ways:
- Expose 10k+ tools to your AI app or agent and call them on behalf of your customers
- Send custom requests to any one of the 2500+ APIs using the Connect API proxy
- Use Pipedream's visual workflow builder to define complex logic to run on behalf of your users
- Embed Pipedream components directly in your app to run actions and triggers on their behalf
- Test end to end in development
- Ship to production!