npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pipedream/gmail

v0.1.12

Published

Pipedream Gmail Components

Downloads

45

Readme

Overview

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.

Getting Started

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.

Configuring a Gmail OAuth client in Google Cloud Platform

To get started, you'll need the following:

  • A Google Cloud account
  • Basic familiarity with Google Cloud Console

Quickstart

  1. Create a custom Gmail client in Google Cloud Console
  2. Enable Gmail API and Pub/Sub API
  3. Create OAuth credentials and a service account
  4. Set up a custom OAuth client in Pipedream
  5. Connect your Gmail account using the custom client and service account

For detailed instructions, follow the steps below.

Detailed Setup Instructions

1. Create a Gmail app

  1. Sign in to the Google Cloud Console

  2. Select an existing project, or create a new one

    Select an existing project or create a new one in the Google Cloud Console

  3. Select APIs & Services

  4. Click Enable APIs & Services

    Select "Enable APIs & Services to open a menu to enable the Gmail API for Pipedream to connect to

  5. Search for and select Gmail API

  6. Click Enable

    Search for and select the Gmail Enterprise API

  7. Search for and select Cloud Pub/Sub API

  8. Click Enable

    Search for and select the Cloud Pub/Sub API

Note: If you encounter issues with API enablement, ensure you have the necessary permissions in your Google Cloud project.

2. Set up the OAuth consent screen

  1. Click OAuth consent screen on the left side

    Click "OAuth consent screen" in the left navigation menu

  2. Set up the OAuth consent screen:

    • Select User Type (Internal for Google Workspace users, External for others)
    • Fill in required fields
    • Add scopes: email, profile, https://www.googleapis.com/auth/gmail.modify, https://www.googleapis.com/auth/gmail.settings.basic
    • Add your email as a test user
    • Review and complete the setup

    Select "External" in the OAuth Consent Screen

3. Create OAuth Credentials in Google and Custom OAuth Client in Pipedream

  1. Navigate to the Credentials section on the left side.

    Open the Credentials menu in the left hand nav bar

  2. Click Create Credentials at the top and select OAuth client ID

    Click create credentials to start the process

    Select the OAuth Client ID option

  3. Select Web application for Application type

    Web application is the type of OAuth credential we're generating

  4. Name the app, e.g. "Pipedream".

  5. In a new window, navigate to the Accounts page in Pipedream, and click OAuth Clients.

    Custom OAuth Client creation on Pipedream

  6. Click New OAuth Client, and search for Gmail.

  7. Name your OAuth Client, and click Continue.

  8. Copy the Redirect URI, and return to your previous window.

  9. On your Google Cloud app configuration page, click Add URI and paste the Redirect URI from the previous step.

    Add the Pipedream URL to the Callback Redirect URL option

  10. Click Create to create your new OAuth keys.

    Store the Client ID and Client Secret keys

  11. Copy the Client ID and Client Secret, and paste them in your OAuth Client configuration on Pipedream.

    Custom OAuth Client creation on Pipedream

Important: When creating the OAuth client ID, make sure to copy the Redirect URI from Pipedream exactly as shown to avoid authentication errors.

4. Create service account

  1. Navigate to Credentials under APIs & Services, and click Create Credentials > Service Account.

    Service Account Creation

  2. Add a name and description for your service account, and grant the service account the role Pub/Sub Admin, and click Done.

    Role administering

  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.

    Create private key

5. Connect your Gmail account in Pipedream

  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.
  2. While configuring the New Email Received trigger, you should be prompted to input your Service Account Key JSON.

6. Publish your custom Gmail app (required for External app type only)

Google has a 7 day expiration window 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.

  1. Navigate to your application, and click OAuth Consent Screen on the lefthand sidebar.
  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.
  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.
  4. The publishing status should be set to In production, and your account should maintain its connection without an expiration window.

Publish your application

Confirmation of changes

Troubleshooting

  • 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.
  • API Not Enabled: Ensure both Gmail API and Pub/Sub API are enabled in your Google Cloud project.
  • 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.

If you continue to experience issues, please contact Pipedream support for further assistance.