
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
gmail-api-node
Advanced tools
This module is designed to make Gmail api interaction easier using google-api-nodejs-client. Note that the module is under development and have no many methods at this moment.
npm install gmail-api-node
Before any interaction you need to retreive a session token, so you can do it in two ways:
const token = {
"access_token": "TOKEN",
"refresh_token": "TOKEN",
"scope": "https://www.googleapis.com/auth/gmail.modify",
"token_type":"Bearer",
"expiry_date":1654000000000
};
const gmail = new Gmail({
client_secret: process.env.CLIENT_SECRET,
client_id: process.env.CLIENT_ID,
redirect_uris: [ "http://localhost:3000" ],
token
});
await gmail.authorize()
const gmail = new Gmail({
client_secret: process.env.CLIENT_SECRET,
client_id: process.env.CLIENT_ID,
redirect_uris: [ "http://localhost:3000" ],
});
const authUrl = gmail.authUrl;
// go to url and return the given code
const code = getCode() // Feel free to get the code from user in any way.
await gmail.authorize(code);
// the token is created, you can store it to reuse it by using the first method
const token = gmail.token
Here is an example for retrieving the first 10 mails from inbox
const messages = await gmail.listMessages({
userId: "me",
maxResults: 10,
q: "label:inbox"
});
// fetch data from message (author, subject, body...)
await Promise.all(messages.map(async message => message.fetch()));
console.log(messages)
FAQs
Gmail api wrapper
The npm package gmail-api-node receives a total of 2 weekly downloads. As such, gmail-api-node popularity was classified as not popular.
We found that gmail-api-node 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.