{"id":21997724,"url":"https://github.com/osfunapps/os-gmail-handler-npm","last_synced_at":"2026-04-30T22:36:34.625Z","repository":{"id":98762353,"uuid":"424510694","full_name":"osfunapps/os-gmail-handler-npm","owner":"osfunapps","description":"This module contains simplified Gmail API commands (search/read/send emails).","archived":false,"fork":false,"pushed_at":"2021-11-04T09:04:55.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T17:50:13.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osfunapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-04T07:43:18.000Z","updated_at":"2023-03-29T09:39:12.000Z","dependencies_parsed_at":"2023-05-25T05:30:17.067Z","dependency_job_id":null,"html_url":"https://github.com/osfunapps/os-gmail-handler-npm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osfunapps/os-gmail-handler-npm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-gmail-handler-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-gmail-handler-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-gmail-handler-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-gmail-handler-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osfunapps","download_url":"https://codeload.github.com/osfunapps/os-gmail-handler-npm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-gmail-handler-npm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32479448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T22:17:53.206Z","updated_at":"2026-04-30T22:36:29.616Z","avatar_url":"https://github.com/osfunapps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n------------\n\nThis module contains simplified Gmail API commands (search/read/send emails).\n\n## Installation\nInstall via npm:\n```js\nnpm i os-gmail-handler\n```\n\n## Allow Gmail API\nTo allow this repo to run, you have to supply your gmail JSON credentials to the handler. \n\nTo do so, follow these steps:\n1) Go to the Google Cloud Console and open a new project. Search for \"Gmail API\", enable it\n2) In the Google Cloud Console, Click on the drawer at the top left and click API \u0026 Services -\u003e Credentials\n3) At the top \"Create credentials\" -\u003e \"OAuth client ID\" -\u003e \"Desktop app\"\n4) Save the credentials JSON on a secured location on your computer\n\n# Usage       \n\n- Require the api handler:\n```js\nconst gmailApi = require(\"os-gmail-handler\")\n```\n\nThen initiate the handler and run it:\n```js\nfunction start() {\n    gmailApi.init(\"path/to/your/credentials.json\", \"path/to/store/your/token.json\", onPostLoad)\n}\n\n// this callback will run after the API initialization\nasync function onPostLoad(auth) {\n\n    // use the msgSearcher instance to find new messages from your girlfriends.\n    // (change the query to search whatever you like. Be advised that it doesn't work exactly like the search in the Gmail web app. Read more about it here:\n    // https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n    let msgs = await gmailApi.msgSearcher.searchMessages(auth, \"subject:Hey honey\", gmailApi.msgSearcher.LABEL_UNREAD)\n\n    // run on all of those messages\n    for (let i = 0; i \u003c msgs.length; i++) {\n        \n        // read them one by one\n        let msgRead = await gmailApi.msgReader.readMessage(auth, msgs[i].id)\n        \n        // get the name of the girlfriend\n        let from = gmailApi.msgTools.getFrom(msgRead)\n        \n        // send a new message to the girlfriend\n        await gmailApi.msgSender.sendMessage(auth, from.email, \"Whatcha doin tonight?\", \"haha funny and corny content\")\n    }\n}\n\nstart()\n```\nAnd more...\n\n\n## Links -\u003e see more tools\n* [os-tools-npm](https://github.com/osfunapps/os-tools-npm) -\u003e This module contains fundamental functions to implement in an npm project\n* [os-file-handler-npm](https://github.com/osfunapps/os-file-handler-npm) -\u003e This module contains fundamental files manipulation functions to implement in an npm project\n* [os-file-stream-handler-npm](https://github.com/osfunapps/os-file-stream-handler-npm) -\u003e This module contains read/write and more advanced operations on files\n* [os-xml-handler-npm](https://github.com/osfunapps/os-xml-handler-npm) -\u003e This module will build, read and manipulate an xml file. Other handy stuff is also available, like search for specific nodes\n\n[GitHub - osfunappsapps](https://github.com/osfunapps)\n\n## Licence\nISC","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-gmail-handler-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosfunapps%2Fos-gmail-handler-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-gmail-handler-npm/lists"}