How to use gmail-js - 1 common examples

To help you get started, we’ve selected a few gmail-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github josteink / gmailjs-node-boilerplate / src / extension.js View on Github external
"use strict";

console.log("Extension loading...");
const jQuery = require("jquery");
const $ = jQuery;
const GmailFactory = require("gmail-js");
const gmail = new GmailFactory.Gmail($);
window.gmail = gmail;

gmail.observe.on("load", () => {
    const userEmail = gmail.get.user_email();
    console.log("Hello, " + userEmail + ". This is your extension talking!");

    gmail.observe.on("view_email", (domEmail) => {
        console.log("Looking at email:", domEmail);
        const emailData = gmail.new.get.email_data(domEmail);
        console.log("Email data:", emailData);
    });
});

gmail-js

JavaScript API for Gmail (useful for chrome extensions)

MIT
Latest version published 3 months ago

Package Health Score

82 / 100
Full package analysis

Popular gmail-js functions