Most of your interactions with the Connect API will likely happen on the server, to protect API requests and user credentials. You’ll use the SDK in your frontend to let users connect accounts. Once connected, you’ll use the SDK on the server to retrieve account info, invoke workflows on their behalf, and more.
Copy
Ask AI
import { PipedreamClient } from "@pipedream/sdk";// These secrets should be saved securely and passed to your environmentconst client = new PipedreamClient({ clientId: "{oauth_client_id}", clientSecret: "{oauth_client_secret}", projectId: "{project_id}", projectEnvironment: "development", // or "production"});// The client provides methods to interact with the Connect API
You’ll primarily use the browser client to let your users securely connect apps from your frontend. When making calls from the browser, you’ll use short-lived Connect tokens to authenticate requests.
import { PipedreamClient } from "@pipedream/sdk"// Example from our Next.js appimport { serverConnectTokenCreate } from "./server"const { token, expires_at } = await serverConnectTokenCreate({ external_user_id: externalUserId // The end user's ID in your system});export default function Home() { const client = new PipedreamClient() function connectAccount() { client.connectAccount({ 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, // The token you received from your server above onSuccess: ({ id: accountId }) => { console.log(`Account successfully connected: ${accountId}`) } }) } return ( <main> <button onClick={connectAccount}>Connect your account</button> </main> )}
The Python SDK is for server-side use. Install it to build backend services and APIs that interact with Pipedream Connect as part of your full-stack application.
from pipedream import Pipedream# These secrets should be saved securely and passed to your environmentpd = Pipedream( client_id="{oauth_client_id}", client_secret="{oauth_client_secret}", project_id="{project_id}", project_environment="development" # or "production")# The client provides methods to interact with the Connect API
The Java SDK is for server-side use in JVM-based applications. Use it to build Java backends, Spring Boot applications, and other JVM services that integrate with Pipedream Connect.
Like the Python SDK, the Java SDK is designed for server-side applications. Use it to securely manage user connections, retrieve account info, and interact with the Connect API from your Java backend.
Copy
Ask AI
import com.pipedream.api.BaseClient;// These secrets should be saved securely and passed to your environmentBaseClient client = BaseClient .builder() .clientId("{oauth_client_id}") .clientSecret("{oauth_client_secret}") .projectId("{project_id}") .projectEnvironment("development") // or "production" .build();// The client provides methods to interact with the Connect API