Skip to content

Commit fab4297

Browse files
readme updates (#14114)
1 parent 0815176 commit fab4297

File tree

3 files changed

+137
-147
lines changed

3 files changed

+137
-147
lines changed

components/gmail/README.md

Lines changed: 134 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,144 @@
11
# Overview
2+
23
By connecting your personal Gmail account to Pipedream, you'll be able to incorporate email into whatever you're building with any of the thousands of apps that are available on Pipedream.
34

45
# Getting Started
56

6-
To connect your Gmail account to Pipedream, just accept the prompt when connecting your Gmail account.
7+
To connect your Gmail account to Pipedream, just accept the prompt when connecting your Gmail account. To connect your account with your own OAuth client, see below.
8+
9+
## Configuring a Gmail OAuth client in Google Cloud Platform
10+
11+
To get started, you'll need the following:
12+
13+
- A Google Cloud account
14+
- Basic familiarity with Google Cloud Console
15+
16+
## Quickstart
17+
18+
1. Create a custom Gmail client in Google Cloud Console
19+
2. Enable Gmail API and Pub/Sub API
20+
3. Create OAuth credentials and a service account
21+
4. Set up a custom OAuth client in Pipedream
22+
5. Connect your Gmail account using the custom client and service account
23+
24+
For detailed instructions, follow the steps below.
25+
26+
## Detailed Setup Instructions
27+
28+
### 1. Create a Gmail app
29+
30+
1. Sign in to the [Google Cloud Console](https://console.cloud.google.com/welcome)
31+
2. Select an existing project, or create a new one
32+
33+
![Select an existing project or create a new one in the Google Cloud Console](https://res.cloudinary.com/pipedreamin/image/upload/v1663268100/docs/components/CleanShot_2022-09-15_at_14.54.34_vajyds.png)
34+
35+
3. Select **APIs & Services**
36+
4. Click **Enable APIs & Services**
37+
38+
![Select "Enable APIs & Services to open a menu to enable the Gmail API for Pipedream to connect to](https://res.cloudinary.com/pipedreamin/image/upload/v1663268316/docs/components/CleanShot_2022-09-15_at_14.58.06_jshirk.png)
39+
40+
5. Search for and select **[Gmail API](https://console.cloud.google.com/apis/library/gmail.googleapis.com)**
41+
6. Click **Enable**
42+
43+
![Search for and select the Gmail Enterprise API](https://res.cloudinary.com/pipedreamin/image/upload/v1663268442/docs/components/CleanShot_2022-09-15_at_15.00.22_skvwei.gif)
44+
45+
7. Search for and select **[Cloud Pub/Sub API](https://console.cloud.google.com/apis/library/pubsub.googleapis.com)**
46+
8. Click **Enable**
47+
48+
![Search for and select the Cloud Pub/Sub API](https://res.cloudinary.com/dpenc2lit/image/upload/v1724881089/Screenshot_2024-08-28_at_2.36.59_PM_ds4knm.png)
49+
50+
> **Note:** If you encounter issues with API enablement, ensure you have the necessary permissions in your Google Cloud project.
51+
52+
### 2. Set up the OAuth consent screen
53+
54+
1. Click **OAuth consent screen** on the left side
55+
56+
![Click "OAuth consent screen" in the left navigation menu](https://res.cloudinary.com/pipedreamin/image/upload/v1663268506/docs/components/CleanShot_2022-09-15_at_15.01.24_wravfb.png)
57+
58+
2. Set up the OAuth consent screen:
59+
60+
- Select User Type (Internal for Google Workspace users, External for others)
61+
- Fill in required fields
62+
- Add scopes: `email`, `profile`, `https://www.googleapis.com/auth/gmail.modify`, `https://www.googleapis.com/auth/gmail.settings.basic`
63+
- Add your email as a test user
64+
- Review and complete the setup
65+
66+
![Select "External" in the OAuth Consent Screen](https://res.cloudinary.com/pipedreamin/image/upload/v1663268545/docs/components/CleanShot_2022-09-15_at_15.02.22_fiekq1.png)
67+
68+
### 3. Create OAuth Credentials in Google and Custom OAuth Client in Pipedream
69+
70+
1. Navigate to the **Credentials** section on the left side.
71+
72+
![Open the Credentials menu in the left hand nav bar](https://res.cloudinary.com/pipedreamin/image/upload/v1663269973/docs/components/CleanShot_2022-09-15_at_15.13.52_yvllxi.png)
73+
74+
2. Click **Create Credentials** at the top and select **OAuth client ID**
75+
76+
![Click create credentials to start the process](https://res.cloudinary.com/pipedreamin/image/upload/v1663270014/docs/components/CleanShot_2022-09-15_at_15.14.15_hjulis.png)
77+
78+
![Select the OAuth Client ID option](https://res.cloudinary.com/pipedreamin/image/upload/v1663270093/docs/components/CleanShot_2022-09-15_at_15.14.39_juqtnm.png)
79+
80+
3. Select **Web application** for **Application type**
81+
82+
![Web application is the type of OAuth credential we're generating](https://res.cloudinary.com/pipedreamin/image/upload/v1663270117/docs/components/CleanShot_2022-09-15_at_15.14.56_hlseq6.png)
83+
84+
4. Name the app, e.g. "Pipedream".
85+
5. In a new window, navigate to the [Accounts](https://pipedream.com/accounts) page in **Pipedream**, and click **OAuth Clients**.
86+
87+
![Custom OAuth Client creation on Pipedream](https://res.cloudinary.com/dpenc2lit/image/upload/v1724882777/Screenshot_2024-08-28_at_2.53.15_PM_rxtusm.png)
88+
89+
6. Click **New OAuth Client**, and search for Gmail.
90+
7. Name your OAuth Client, and click **Continue**.
91+
8. Copy the **Redirect URI**, and return to your previous window.
92+
9. On your Google Cloud app configuration page, click **Add URI** and paste the Redirect URI from the previous step.
93+
94+
![Add the Pipedream URL to the Callback Redirect URL option](https://res.cloudinary.com/pipedreamin/image/upload/v1663270187/docs/components/CleanShot_2022-09-15_at_15.16.10_hvbocb.png)
95+
96+
10. Click **Create** to create your new OAuth keys.
97+
98+
![Store the Client ID and Client Secret keys](https://res.cloudinary.com/pipedreamin/image/upload/v1663270250/docs/components/CleanShot_2022-09-15_at_15.16.29_hvxnkx.png)
99+
100+
11. Copy the Client ID and Client Secret, and paste them in your OAuth Client configuration on Pipedream.
101+
102+
![Custom OAuth Client creation on Pipedream](https://res.cloudinary.com/dpenc2lit/image/upload/v1724956524/Screenshot_2024-08-29_at_11.34.55_AM_t7tjkh.png)
103+
104+
> **Important:** When creating the OAuth client ID, make sure to copy the Redirect URI from Pipedream exactly as shown to avoid authentication errors.
105+
106+
### 4. Create service account
107+
108+
1. Navigate to **[Credentials](https://console.cloud.google.com/apis/credentials?)** under APIs & Services, and click **Create Credentials** > **Service Account**.
109+
110+
![Service Account Creation](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964633/Screenshot_2024-08-29_at_1.44.04_PM_om14xp.png)
111+
112+
2. Add a name and description for your service account, and grant the service account the role **Pub/Sub Admin**, and click **Done**.
113+
114+
![Role administering](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964633/Screenshot_2024-08-29_at_1.47.02_PM_chdjkl.png)
115+
116+
3. Click on the service account that you created, and click **Keys** > **Add Key** > **Create New Key** > **JSON**. This will download the service account JSON credentials to your computer. Be sure to save this securely.
117+
118+
![Create private key](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964634/Screenshot_2024-08-29_at_1.47.34_PM_tmalc7.png)
119+
120+
### 5. Connect your Gmail account in Pipedream
121+
122+
1. From the Pipedream Accounts page, click **OAuth Clients**. Next to your newly created Gmail client, click the three-dot menu on the righthand side and click **Connect Account**. Or you can also connect your account from the workflow builder, when configuring the Gmail trigger.
123+
2. While configuring the New Email Received trigger, you should be prompted to input your Service Account Key JSON.
124+
125+
### 6. Publish your custom Gmail app (required for External app type only)
126+
127+
Google has a [7 day expiration window](https://developers.google.com/identity/protocols/oauth2#:~:text=A%20Google%20Cloud,Connect%20equivalents) on refresh tokens for **External** applications with a publishing status of "Testing", so you will need to **Publish** your application in order to maintain your account connection.
128+
129+
1. Navigate to your application, and click **OAuth Consent Screen** on the lefthand sidebar.
130+
2. Under **Publishing status**, click **Publish App**. If you included any sensitive or restricted scopes in your app, there will be a disclosure stating that you will need to go through the process of verification. Click **Confirm**.
131+
3. Your application will not be available externally unless you share your **client_id** with others, and you will not have to go through the verification process unless you intend to onboard over 100 users.
132+
4. The publishing status should be set to **In production**, and your account should maintain its connection without an expiration window.
7133

8-
## What's the difference between the **Gmail** app and the **Gmail Developer App**?
134+
![Publish your application](https://res.cloudinary.com/dpenc2lit/image/upload/v1698166716/Screenshot_2023-10-24_at_9.50.06_AM_lve7wq.png)
9135

10-
Google requires integration platforms such as Pipedream, to restrict the scopes users can enable for Gmail, in order to regulate the ability of users to build workflows and connect applications.
136+
![Confirmation of changes](https://res.cloudinary.com/dpenc2lit/image/upload/v1698166716/Screenshot_2023-10-24_at_9.50.18_AM_mndtyc.png)
11137

12-
Currently, the **Gmail** app on Pipedream is limited to only sending emails on behalf of your Gmail email address associated with this app.
138+
# Troubleshooting
13139

14-
However, the **Gmail Developer App** is unrestricted because you have the ability to control the scopes through creating your own Google Cloud Project.
140+
- **Authentication Failed**: Double-check that your Redirect URI is correct and that you've added your email as a test user in the OAuth consent screen.
141+
- **API Not Enabled**: Ensure both Gmail API and Pub/Sub API are enabled in your Google Cloud project.
142+
- **Service Account Issues**: Verify that your service account has the "Pub/Sub Admin" role and that you've correctly pasted the JSON key into Pipedream.
15143

16-
Because you can define your own scopes, you can read and write emails with your own Google Cloud Project. To learn how to create and authenticate a **Gmail Developer App** read [our setup guide](https://pipedream.com/apps/gmail-custom-oauth).
144+
If you continue to experience issues, please contact Pipedream support for further assistance.
Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,3 @@
11
# Overview
22

33
The Gmail - New Email Received (Instant) source enables you to trigger Pipedream workflows based on real-time changes to your Gmail inbox.
4-
5-
# Getting Started
6-
7-
## Prerequisites
8-
9-
- A Google Cloud account
10-
- A Pipedream account on the Advanced plan or higher
11-
- Basic familiarity with Google Cloud Console
12-
13-
## Quickstart
14-
15-
1. Create a custom Gmail client in Google Cloud Console
16-
2. Enable Gmail API and Pub/Sub API
17-
3. Create OAuth credentials and a service account
18-
4. Set up a custom OAuth client in Pipedream
19-
5. Connect your Gmail account using the custom client and service account
20-
21-
For detailed instructions, follow the steps below.
22-
23-
## Detailed Setup Instructions
24-
25-
### 1. Create a Gmail app
26-
27-
1. Sign in to the [Google Cloud Console](https://console.cloud.google.com/welcome)
28-
2. Select an existing project, or create a new one
29-
30-
![Select an existing project or create a new one in the Google Cloud Console](https://res.cloudinary.com/pipedreamin/image/upload/v1663268100/docs/components/CleanShot_2022-09-15_at_14.54.34_vajyds.png)
31-
32-
3. Select **APIs & Services**
33-
4. Click **Enable APIs & Services**
34-
35-
![Select "Enable APIs & Services to open a menu to enable the Gmail API for Pipedream to connect to](https://res.cloudinary.com/pipedreamin/image/upload/v1663268316/docs/components/CleanShot_2022-09-15_at_14.58.06_jshirk.png)
36-
37-
5. Search for and select **[Gmail API](https://console.cloud.google.com/apis/library/gmail.googleapis.com)**
38-
6. Click **Enable**
39-
40-
![Search for and select the Gmail Enterprise API](https://res.cloudinary.com/pipedreamin/image/upload/v1663268442/docs/components/CleanShot_2022-09-15_at_15.00.22_skvwei.gif)
41-
42-
7. Search for and select **[Cloud Pub/Sub API](https://console.cloud.google.com/apis/library/pubsub.googleapis.com)**
43-
8. Click **Enable**
44-
45-
![Search for and select the Cloud Pub/Sub API](https://res.cloudinary.com/dpenc2lit/image/upload/v1724881089/Screenshot_2024-08-28_at_2.36.59_PM_ds4knm.png)
46-
47-
> **Note:** If you encounter issues with API enablement, ensure you have the necessary permissions in your Google Cloud project.
48-
49-
### 2. Set up the OAuth consent screen
50-
51-
1. Click **OAuth consent screen** on the left side
52-
53-
![Click "OAuth consent screen" in the left navigation menu](https://res.cloudinary.com/pipedreamin/image/upload/v1663268506/docs/components/CleanShot_2022-09-15_at_15.01.24_wravfb.png)
54-
55-
2. Set up the OAuth consent screen:
56-
57-
- Select User Type (Internal for Google Workspace users, External for others)
58-
- Fill in required fields
59-
- Add scopes: `email`, `profile`, `https://www.googleapis.com/auth/gmail.modify`, `https://www.googleapis.com/auth/gmail.settings.basic`
60-
- Add your email as a test user
61-
- Review and complete the setup
62-
63-
![Select "External" in the OAuth Consent Screen](https://res.cloudinary.com/pipedreamin/image/upload/v1663268545/docs/components/CleanShot_2022-09-15_at_15.02.22_fiekq1.png)
64-
65-
### 3. Create OAuth Credentials in Google and Custom OAuth Client in Pipedream
66-
67-
1. Navigate to the **Credentials** section on the left side.
68-
69-
![Open the Credentials menu in the left hand nav bar](https://res.cloudinary.com/pipedreamin/image/upload/v1663269973/docs/components/CleanShot_2022-09-15_at_15.13.52_yvllxi.png)
70-
71-
2. Click **Create Credentials** at the top and select **OAuth client ID**
72-
73-
![Click create credentials to start the process](https://res.cloudinary.com/pipedreamin/image/upload/v1663270014/docs/components/CleanShot_2022-09-15_at_15.14.15_hjulis.png)
74-
75-
![Select the OAuth Client ID option](https://res.cloudinary.com/pipedreamin/image/upload/v1663270093/docs/components/CleanShot_2022-09-15_at_15.14.39_juqtnm.png)
76-
77-
3. Select **Web application** for **Application type**
78-
79-
![Web application is the type of OAuth credential we're generating](https://res.cloudinary.com/pipedreamin/image/upload/v1663270117/docs/components/CleanShot_2022-09-15_at_15.14.56_hlseq6.png)
80-
81-
4. Name the app, e.g. "Pipedream".
82-
5. In a new window, navigate to the [Accounts](https://pipedream.com/accounts) page in **Pipedream**, and click **OAuth Clients**.
83-
84-
![Custom OAuth Client creation on Pipedream](https://res.cloudinary.com/dpenc2lit/image/upload/v1724882777/Screenshot_2024-08-28_at_2.53.15_PM_rxtusm.png)
85-
86-
6. Click **New OAuth Client**, and search for Gmail.
87-
7. Name your OAuth Client, and click **Continue**.
88-
8. Copy the **Redirect URI**, and return to your previous window.
89-
9. On your Google Cloud app configuration page, click **Add URI** and paste the Redirect URI from the previous step.
90-
91-
![Add the Pipedream URL to the Callback Redirect URL option](https://res.cloudinary.com/pipedreamin/image/upload/v1663270187/docs/components/CleanShot_2022-09-15_at_15.16.10_hvbocb.png)
92-
93-
10. Click **Create** to create your new OAuth keys.
94-
95-
![Store the Client ID and Client Secret keys](https://res.cloudinary.com/pipedreamin/image/upload/v1663270250/docs/components/CleanShot_2022-09-15_at_15.16.29_hvxnkx.png)
96-
97-
11. Copy the Client ID and Client Secret, and paste them in your OAuth Client configuration on Pipedream.
98-
99-
![Custom OAuth Client creation on Pipedream](https://res.cloudinary.com/dpenc2lit/image/upload/v1724956524/Screenshot_2024-08-29_at_11.34.55_AM_t7tjkh.png)
100-
101-
> **Important:** When creating the OAuth client ID, make sure to copy the Redirect URI from Pipedream exactly as shown to avoid authentication errors.
102-
103-
### 4. Create service account
104-
105-
1. Navigate to **[Credentials](https://console.cloud.google.com/apis/credentials?)** under APIs & Services, and click **Create Credentials** > **Service Account**.
106-
107-
![Service Account Creation](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964633/Screenshot_2024-08-29_at_1.44.04_PM_om14xp.png)
108-
109-
2. Add a name and description for your service account, and grant the service account the role **Pub/Sub Admin**, and click **Done**.
110-
111-
![Role administering](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964633/Screenshot_2024-08-29_at_1.47.02_PM_chdjkl.png)
112-
113-
3. Click on the service account that you created, and click **Keys** > **Add Key** > **Create New Key** > **JSON**. This will download the service account JSON credentials to your computer. Be sure to save this securely.
114-
115-
![Create private key](https://res.cloudinary.com/dpenc2lit/image/upload/v1724964634/Screenshot_2024-08-29_at_1.47.34_PM_tmalc7.png)
116-
117-
### 5. Connect your Gmail account in Pipedream
118-
119-
1. From the Pipedream Accounts page, click **OAuth Clients**. Next to your newly created Gmail client, click the three-dot menu on the righthand side and click **Connect Account**. Or you can also connect your account from the workflow builder, when configuring the Gmail trigger.
120-
2. While configuring the New Email Received trigger, you should be prompted to input your Service Account Key JSON.
121-
122-
### 6. Publish your custom Gmail app (required for External app type only)
123-
124-
Google has a [7 day expiration window](https://developers.google.com/identity/protocols/oauth2#:~:text=A%20Google%20Cloud,Connect%20equivalents) on refresh tokens for **External** applications with a publishing status of "Testing", so you will need to **Publish** your application in order to maintain your account connection.
125-
126-
1. Navigate to your application, and click **OAuth Consent Screen** on the lefthand sidebar.
127-
2. Under **Publishing status**, click **Publish App**. If you included any sensitive or restricted scopes in your app, there will be a disclosure stating that you will need to go through the process of verification. Click **Confirm**.
128-
3. Your application will not be available externally unless you share your **client_id** with others, and you will not have to go through the verification process unless you intend to onboard over 100 users.
129-
4. The publishing status should be set to **In production**, and your account should maintain its connection without an expiration window.
130-
131-
![Publish your application](https://res.cloudinary.com/dpenc2lit/image/upload/v1698166716/Screenshot_2023-10-24_at_9.50.06_AM_lve7wq.png)
132-
133-
![Confirmation of changes](https://res.cloudinary.com/dpenc2lit/image/upload/v1698166716/Screenshot_2023-10-24_at_9.50.18_AM_mndtyc.png)
134-
135-
# Troubleshooting
136-
137-
- **Authentication Failed**: Double-check that your Redirect URI is correct and that you've added your email as a test user in the OAuth consent screen.
138-
- **API Not Enabled**: Ensure both Gmail API and Pub/Sub API are enabled in your Google Cloud project.
139-
- **Service Account Issues**: Verify that your service account has the "Pub/Sub Admin" role and that you've correctly pasted the JSON key into Pipedream.
140-
141-
If you continue to experience issues, please contact Pipedream support for further assistance.

components/gmail/sources/new-email-received/new-email-received.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
name: "New Email Received",
1616
description: "Emit new event when a new email is received.",
1717
type: "source",
18-
version: "0.1.3",
18+
version: "0.1.4",
1919
dedupe: "unique",
2020
props: {
2121
gmail,
@@ -28,7 +28,7 @@ export default {
2828
"polling",
2929
],
3030
description:
31-
"Configuring this source as a `webhook` (instant) trigger requires a custom OAuth client. [Refer to the guide here to get started](https://pipedream.com/apps/gmail/triggers/new-email-received#getting-started).",
31+
"Configuring this source as a `webhook` (instant) trigger requires a custom OAuth client. [Refer to the guide here to get started](https://pipedream.com/apps/gmail/#getting-started).",
3232
reloadProps: true,
3333
},
3434
serviceAccountKeyJson: {
@@ -117,7 +117,7 @@ export default {
117117
const isValidClientId = await this.checkClientId();
118118
if (!isValidClientId) {
119119
throw new ConfigurationError(
120-
"Configuring this source as a `webhook` (instant) trigger requires a custom OAuth client. [Refer to the guide here to get started](https://pipedream.com/apps/gmail/triggers/new-email-received#getting-started).",
120+
"Configuring this source as a `webhook` (instant) trigger requires a custom OAuth client. [Refer to the guide here to get started](https://pipedream.com/apps/gmail/#getting-started).",
121121
);
122122
}
123123

0 commit comments

Comments
 (0)