-
Notifications
You must be signed in to change notification settings - 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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning Rate limit exceeded@dannyroosevelt has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe pull request introduces significant updates to the documentation for Pipedream Connect. It adds several new sections in the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Outside diff range and nitpick comments (14)
docs-v2/pages/connect/tokens.mdx (3)
1-11
: Consider enhancing the formatting for better readability.The content is clear and well-structured, but could benefit from some formatting improvements:
- Consider using bold text for the two main options to make them stand out
- The Slack example could be formatted as a callout or info block for better visibility
# 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. +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. +> **Example Use Case**: Use tokens when you want to handle the account connection flow yourself, in your app's UI. For instance, 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.
12-14
: Consider adding a brief example or context.The section would be more helpful with:
- A brief description of the token creation process
- A simple example showing the required parameters
- Expected response format
## Creating a token -See docs on [the `/tokens` endpoint](/connect/api/#create-a-new-token) to create new tokens. +To create a new token, you'll need to make a POST request to the `/tokens` endpoint with the following required parameters: + +```json +{ + "external_user_id": "user_123", + "webhook_uri": "https://your-domain.com/webhook" +} +``` + +The endpoint will return a secure token that you can use to initiate the account connection flow. + +For complete API documentation, see [the `/tokens` endpoint](/connect/api/#create-a-new-token).
16-20
: Consider mentioning key webhook events.The section would be more informative if it briefly mentioned the main webhook events users can expect (e.g., CONNECTION_SUCCESS, CONNECTION_ERROR).
## 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. +You'll receive webhook events for key status changes, including: +- `CONNECTION_SUCCESS` when an account is successfully connected +- `CONNECTION_ERROR` if there's an issue during the connection process + [See the webhooks docs](/connect/webhooks) for more information.docs-v2/pages/connect/connect-link.mdx (4)
7-7
: Consider adding security recommendations for URL distribution.When mentioning email/SMS distribution of Connect Links, it would be valuable to add security best practices, such as:
- Recommending secure communication channels
- Advising users to access the link promptly due to the 4-hour expiration
- Warning against sharing the URL with unauthorized parties
Would you like me to provide a suggested addition to the documentation?
19-21
: Enhance code block with syntax highlighting and parameter explanation.Consider these improvements:
- Add syntax highlighting by specifying the language
- Explain the
appSlug
parameter and provide valid examplesApply this change:
-``` +```url https://pipedream.com/_static/connect.html?token={token}&connectLink=true&app={appSlug}Then add: ```markdown where `{appSlug}` is the unique identifier for your app (e.g., "github", "slack", etc.).
30-32
: Enhance redirect URL documentation with examples and security considerations.Consider adding:
- Examples of valid redirect URLs
- Security best practices for redirect URLs (e.g., URL validation, allowed domains)
- Description of what users will see on the default Pipedream-hosted pages
Would you like me to provide a detailed example section covering these points?
11-11
: Minor: Simplify redundant phrasing.The phrase "for getting Connect up and running" can be simplified.
-See [the Connect quickstart](/connect/quickstart) for a full tutorial for getting Connect up and running. +See [the Connect quickstart](/connect/quickstart) for a full tutorial on using Connect.🧰 Tools
🪛 LanguageTool
[style] ~11-~11: This phrase is redundant. Consider writing “Connect”.
Context: ...kstart) for a full tutorial for getting Connect up and running. Here's a quick overview ...(CONNECT_TOGETHER)
docs-v2/pages/connect/webhooks.mdx (1)
16-42
: Enhance the success payload documentation.The JSON example would be more helpful with:
- Field descriptions for each property in the payload
- Valid format examples for IDs and timestamps
- Explanation of the
healthy
anddead
boolean fields- Documentation for all possible values in the
app
objectConsider adding this field description table above the JSON example:
| Field | Type | Description | |-------|------|-------------| | connect_token | string | The token used to initiate the connection | | environment | string | The environment where the connection was created | | connect_session_id | number | Unique identifier for the connection session | | account.id | string | Unique identifier for the connected account | ...docs-v2/pages/connect/oauth-clients.mdx (4)
6-13
: Consider adding security best practices.While the distinction between key-based and OAuth apps is clear, it would be valuable to add a note about security implications and best practices for handling credentials in both cases.
Consider adding a security callout:
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. + <Callout type="warning"> + Always follow security best practices: + - Never commit API keys or OAuth credentials to version control + - Rotate credentials regularly + - Use environment-specific OAuth clients + </Callout>
15-19
: Enhance production deployment requirements.The callout about production deployment could be more specific about why custom OAuth clients are required and what limitations exist without them.
Consider expanding the callout:
<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. + To get started in [development mode](/connect/environments), you can use Pipedream's default OAuth client. However, for production deployments: + - Custom OAuth clients are required for security and rate limiting purposes + - Each environment (staging, production) should use a separate OAuth client + - You'll need to [create an OAuth client](#using-a-custom-oauth-client) for the app you're integrating </Callout>
23-28
: Add code examples for implementation.While the steps are clear, adding code examples for both the frontend SDK and Connect Link would make implementation easier.
Consider adding:
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()`. + ```javascript + // Example using the frontend SDK + await pd.connectAccount({ + app: "github", + oauth_app_id: "your-oauth-app-id" + }); + ``` 5. If using [Connect Link](/connect/quickstart#use-connect-link), make sure to include the `oauth_app_id` in the URL. + ``` + # Example Connect Link URL + https://pipedream.com/connect/oauth?app=github&oauth_app_id=your-oauth-app-id + ```
35-35
: Improve image accessibility.The image's alt text could be more descriptive to better assist users with screen readers.
- <Image src="https://res.cloudinary.com/pipedreamin/image/upload/v1730241292/oauth-app-id_umhhqi.png" alt="Copy OAuth App ID" width={650} height={529} /> + <Image src="https://res.cloudinary.com/pipedreamin/image/upload/v1730241292/oauth-app-id_umhhqi.png" alt="Screenshot showing how to expand OAuth client details and locate the OAuth App ID in the Pipedream dashboard" width={650} height={529} />docs-v2/pages/connect/quickstart.mdx (2)
Line range hint
535-561
: Consider adding security recommendations for token handling.While the code examples are comprehensive, it would be beneficial to add a note about secure token handling practices, such as:
- Not storing tokens in client-side storage
- Using secure session management
- Implementing token rotation
976-977
: Enhance deployment section with additional context.Consider expanding the deployment section to include:
- A brief overview of what changes between development and production
- Common deployment considerations
- Links to troubleshooting guides
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (7)
docs-v2/pages/connect/_meta.json
(1 hunks)docs-v2/pages/connect/connect-link.mdx
(1 hunks)docs-v2/pages/connect/environments.mdx
(1 hunks)docs-v2/pages/connect/oauth-clients.mdx
(1 hunks)docs-v2/pages/connect/quickstart.mdx
(7 hunks)docs-v2/pages/connect/tokens.mdx
(1 hunks)docs-v2/pages/connect/webhooks.mdx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- docs-v2/pages/connect/environments.mdx
🧰 Additional context used
🪛 LanguageTool
docs-v2/pages/connect/connect-link.mdx
[style] ~11-~11: This phrase is redundant. Consider writing “Connect”.
Context: ...kstart) for a full tutorial for getting Connect up and running. Here's a quick overview ...
(CONNECT_TOGETHER)
docs-v2/pages/connect/quickstart.mdx
[duplication] ~27-~27: Possible typo: you repeated a word
Context: ...pipedream.com/projects). 2. From within the the Connect tab in your project, select...
(ENGLISH_WORD_REPEAT_RULE)
🔇 Additional comments (5)
docs-v2/pages/connect/_meta.json (2)
14-27
: LGTM! The new sections follow consistent naming patterns.
The added sections maintain proper JSON structure and follow the existing naming conventions. The titles are well-formatted and clearly describe their corresponding documentation sections.
14-27
: Consider optimizing the navigation order.
While the current order is logical, consider if a different arrangement might provide a better learning path for users. For example:
- Overview (current)
- Use cases (current)
- Quickstart (current)
- Connect Link (moved up as it might be the primary integration method)
- Environments (current position)
- OAuth Clients
- Tokens
- Webhooks
- API & SDK Reference (moved to end as it's typically referenced after understanding basic concepts)
Let's verify if there are any explicit dependencies between these sections:
docs-v2/pages/connect/connect-link.mdx (1)
25-26
: Consider using a more permanent link format.
The shortened workflow URL (tch_EvfbvQ
) might not be permanent. Consider using the full Pipedream workflow URL format for better longevity of the documentation.
docs-v2/pages/connect/webhooks.mdx (1)
1-54
: Verify webhook payload structure against API implementation.
Let's ensure the documented fields match the actual implementation.
✅ Verification successful
Let me try a different search strategy to locate the webhook implementation.
This should help us find webhook-related files and their implementations to verify against the documentation.
Let me try one more search to find the event type definitions and webhook payload structure.
Let me try one final search to find the AppResponse type definition to complete our verification.
Based on the code findings from our searches, I can now provide a final response:
Documentation accurately reflects the webhook payload structure
The documented webhook payload structure in docs-v2/pages/connect/webhooks.mdx
is consistent with the implementation found in the codebase. This is verified by:
-
The Account type definition matches exactly with the documented fields including:
id
,name
,external_id
,healthy
,dead
app
object with fieldsid
,name_slug
,name
,auth_type
,img_src
,custom_fields_json
,categories
created_at
,updated_at
timestamps
-
The webhook configuration is properly implemented in the SDK (
packages/sdk/src/server/index.ts
) with thewebhook_uri
parameter.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for webhook-related code to verify payload structure
echo "Searching for webhook implementation..."
rg -t ts -t js "CONNECTION_SUCCESS|CONNECTION_ERROR" -A 10
ast-grep --pattern 'function $_(req, res) {
$$$
}'
Length of output: 204
Script:
#!/bin/bash
# Search for webhook-related files and implementations
echo "Searching for webhook-related files..."
fd -e ts -e js -e tsx -e jsx webhook -i
echo "Searching for connect token and webhook patterns..."
rg -t ts -t js "webhook.*uri|connect.*token" -B 2 -A 5
echo "Searching for event type definitions..."
rg -t ts -t js "type.*Event.*=.*CONNECTION" -B 1 -A 3
Length of output: 6398
Script:
#!/bin/bash
# Search for webhook payload and event type definitions
echo "Searching for webhook event types..."
rg -t ts -t js "CONNECTION_SUCCESS|CONNECTION_ERROR" --type-add 'dts:*.d.ts' -t dts -t ts -t js
echo "Searching for webhook payload interface or type definitions..."
ast-grep --pattern 'interface $_ {
event: $_;
connect_token: $_;
$$$
}'
echo "Searching for account type definitions..."
ast-grep --pattern 'type Account = {
$$$
}'
Length of output: 3159
Script:
#!/bin/bash
# Search for AppResponse type definition
echo "Searching for AppResponse type..."
ast-grep --pattern 'type AppResponse = {
$$$
}'
echo "Searching for app-related interfaces..."
rg -t ts -t js "interface.*App.*{|type.*App.*=.*{" -A 10
Length of output: 2339
docs-v2/pages/connect/oauth-clients.mdx (1)
1-2
: LGTM: Component imports are correct and necessary.
The imports for Next.js Image and custom Callout components are properly defined and utilized in the documentation.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* cherry picked changes from new docs * Update docs-v2/pages/connect/quickstart.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update docs-v2/pages/connect/tokens.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
WHY
Summary by CodeRabbit
Release Notes
New Features
Documentation Updates