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_custom_oauth

v0.1.13

Published

Pipedream Gmail (Consumer) Components

Downloads

124

Readme

Overview

With the Gmail (Developer App) API on Pipedream, you can automate a variety of email-related tasks, directly manipulating your Gmail account to streamline workflows. From sending emails programmatically to parsing new inbound messages for data extraction, the API allows for deep interaction with your Gmail inbox. Use cases include automating follow-ups, organizing your inbox with filters and labels, and synchronizing important email events with other services to act upon new information instantly.

Getting Started

The Google Developer App in Pipedream can integrate with either a personal Gmail account or a Google workspace email account. Either option involves creating a custom Google App in the Google Cloud Console. This process does not involve any code or special approval by Google. The steps are outlined below:

Creating a Gmail app

In order to connect your personal or workspace Gmail account to Pipedream, you'll need to create a custom OAuth app in Google Cloud.

  1. Sign in to the Google Cloud Console
  2. Select an existing project or create a new one

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

  1. Select APIs & Services
  2. Click Enable APIs & Services

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

  1. Search for and select Gmail API
  2. Click Enable

Search for an select the Gmail Enterprise API

  1. Click OAuth consent screen on the left side

Click "OAuth consent screen" in the left navigation menu

  1. Select External User Type and click “Create”

Select "External" in the OAuth Consent Screen

  1. Fill in the required fields and click Save and Continue
  2. Click Add or remove scopes and select the https://mail.google.com/ scope and then click "Update"
  3. Click Save and Continue to finish the Scopes step
  4. Add your own email as a Test User by clicking *Add Users& then typing in your email in the prompt then clicking Add again. Then finally click Save and Continue to finish the Test Users portion.
  5. You should be prompted with a Summary page.

Now you've created an unlisted Gmail App that you can integrate with Pipedream.

Create OAuth Credentials

You will need to generate a set of OAuth credentials to connect your new Gmail app to Pipedream properly.

  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

  1. Select Web application for Application type

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

  1. Name the app “Pipedream”
  2. Click Add URI and enter https://api.pipedream.com/connect/oauth/oa_G7Ain6/callback

Add the Pipedream URL to the Callback Redirect URL option

  1. Click Create to create your new OAuth keys
  2. Note the client ID and client Secret, but keep these private and secure

Store the Client ID and Client Secret keys

Connect your Gmail app Pipedream with your Gmail app OAuth crendentials

At this point, you should have a Gmail App under your Google Project, and a set of OAuth keys.

  1. Now when prompted in Pipedream after trying to connect a Gmail Developer App, copy and paste your OAuth credentials.

  2. Also select the scopes you chose when defining the app. We recommend using https://mail.google.com/

  3. Then click Connect

  4. If you did not publish your Gmail App in the Google Cloud Console, just click Continue to ignore the warning.

    Click continue if presented with a warning about an unpublished app

  5. Check all of the necessary scopes you'll need for your workflows

    Check all scopes to include grant your integration permission

  6. Click the final Connect and your custom Gmail app should be integrated into Pipedream!

Publish your custom Gmail app

Google has a 7 day expiration window on refresh tokens for 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

Example Use Cases

  • Email Digest Aggregator: Collect and send a daily digest email of all the new messages from a specific label or search query. This could integrate with Slack, sending a summary message to a designated channel every morning.

  • Customer Support Auto-Responder: Instantly acknowledge incoming support requests by triggering an auto-response email. This workflow can be enhanced by using sentiment analysis via an AI service to categorize the urgency of the request.

  • Invoice Processing: Detect emails with invoices attached, extract relevant data, and input it into an accounting app like QuickBooks. Upon receipt, the workflow can also send back a confirmation email to the sender.

Troubleshooting

Application disconnects after 7 days If your developer application disconnects after 7 days, you need to follow the steps above to Publish your custom Gmail app in order to keep your account connected.