
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
gmail-inbox
Advanced tools
Gmail-inbox is a simplified gmail API to receive emails in coding. It helps with end-to-end testing your signup process, test email functionality and automate processes that require receiving emails.
Install the dependencies
$ npm install -S gmail-inbox
Complete examples can be found in the examples/
folder
import { Inbox } from 'gmail-inbox';
async function exeCuteMe(){
let inbox = new Inbox('credentials.json');
await inbox.authenticateAccount(); // logs user in
let messages = await inbox.getInboxMessages();
console.log("my inbox messages", JSON.stringify(messages,null,4));
// Note: give https://github.com/ismail-codinglab/gmail-inbox a star if it saved you time!
}
exeCuteMe();
To work with the gmail API you need to get the credentials from the google cloud console.
Step 1 Follow the google instructions to Create a client ID and client secret.
Step 2 Go to https://console.cloud.google.com/apis/credentials and download the OAuth2 credentials file, as shown in the image below.
Your credentials file (commmonly named client_secret_*.json), should look similar to image below
Note: make sure you selected 'other' as project and that the redirect_uris
contains something like "urn:ietf:wg:oauth:2.0:oob"
Step 3 Copy the example code in #example and execute the script
Step 4
The application will prompt to visit the authorization url. Navigate to the url, select your email and copy the code as shown in the image below.
Note: The authorization token will only be valid for 6 months, after 6 months a renewal is required.
Step 5 Done! You're good to go, you should be able to see your inbox messages, enjoy coding! :)
Want to contribute? Great!
Help us by creating a pull request
FAQs
Receive Gmail emails in code!
The npm package gmail-inbox receives a total of 2,694 weekly downloads. As such, gmail-inbox popularity was classified as popular.
We found that gmail-inbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.