{"_id":"@anura-gate/watcher-gmail","_rev":"3-a574848313246bf5357aafaf260d4068","name":"@anura-gate/watcher-gmail","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@anura-gate/watcher-gmail","version":"0.1.0","keywords":["gate","watcher","gmail","email","self-hosted"],"license":"MIT","_id":"@anura-gate/watcher-gmail@0.1.0","maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"bin":{"gate-watcher-gmail":"cli.js"},"dist":{"shasum":"88ab31e9e91bf4f915ece0efacb7e391f0b3c8aa","tarball":"https://registry.npmjs.org/@anura-gate/watcher-gmail/-/watcher-gmail-0.1.0.tgz","fileCount":7,"integrity":"sha512-aH29HowHRJl+cEV+fSjRMnm1Wqx1vbsZ9PSOMVSKT1DmeY5M1bQP5h7z573AO4k1gBB4Ffba4QvqgZr1O2qEpw==","signatures":[{"sig":"MEQCIEiGltYanm4bQItilb6cwhv2ko162sFioXffu7JDwFG1AiAeyHkGXnepTH7BhMEUWOotcLpRfFXY2I6Jb0OnBPjk8Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47961},"main":"index.js","engines":{"node":">=18"},"gitHead":"31f6005b6c29877c63e318196e473f2012f41aec","scripts":{"start":"node cli.js"},"_npmUser":{"name":"anuragate","email":"ahmadajmal1514@gmail.com"},"_npmVersion":"10.9.2","description":"GATE Watcher — Self-hosted Gmail monitor. Credentials never leave your machine.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"dotenv":"^17.3.1","qrcode":"^1.5.4","imapflow":"^1.0.171"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/watcher-gmail_0.1.0_1771499632190_0.22058849182372375","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anura-gate/watcher-gmail","version":"0.2.0","keywords":["gate","watcher","gmail","email","self-hosted"],"license":"MIT","_id":"@anura-gate/watcher-gmail@0.2.0","maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"bin":{"gate-watcher-gmail":"cli.js"},"dist":{"shasum":"dcf6d1fabdabe5b0e4ee8143a63f5b30aa18fa0d","tarball":"https://registry.npmjs.org/@anura-gate/watcher-gmail/-/watcher-gmail-0.2.0.tgz","fileCount":7,"integrity":"sha512-ZuVOHibPTOcC0UQ6KtdLrdH62Mc9cYkY/qL50w9mB/n3x1QqRll86q78S/UA3Culizzn/MWaOTyq0T6J7g79Ow==","signatures":[{"sig":"MEUCIGqx4RfTUiaHiBmuLT8AwOeMSHHrojVZZ60J4PnoxhxBAiEAp+eW3yB/XbtTWB9HHnO4lwQMjF+IEtT72qS4drRHXMs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48888},"main":"index.js","engines":{"node":">=18"},"gitHead":"9de498efc9037d0f60a6b830ab7df915d5e8dbfc","scripts":{"start":"node cli.js"},"_npmUser":{"name":"anuragate","email":"ahmadajmal1514@gmail.com"},"_npmVersion":"10.9.2","description":"GATE Watcher — Self-hosted Gmail monitor. Credentials never leave your machine.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"dotenv":"^17.3.1","qrcode":"^1.5.4","imapflow":"^1.0.171"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/watcher-gmail_0.2.0_1772343245099_0.9427568765120116","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@anura-gate/watcher-gmail","version":"0.4.0","description":"GATE Watcher — Self-hosted Gmail monitor. Credentials never leave your machine.","main":"index.js","bin":{"gate-watcher-gmail":"cli.js"},"scripts":{"start":"node cli.js"},"keywords":["gate","watcher","gmail","email","self-hosted"],"license":"MIT","homepage":"https://anuragate.com","repository":{"type":"git","url":"git+https://github.com/ahmad-ajmal/AnuraGate_Sample.git"},"dependencies":{"dotenv":"^17.3.1","imapflow":"^1.0.171","qrcode":"^1.5.4"},"engines":{"node":">=18"},"_id":"@anura-gate/watcher-gmail@0.4.0","gitHead":"0ebb362ebdf75c602ccbaa15cb7db91b80f2901d","bugs":{"url":"https://github.com/ahmad-ajmal/AnuraGate_Sample/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-i+d0xZX6aCWZ82p9FSlk0hWBy/wPy+Ind1x0E2A7Hwq//8H4GPZr0EMfKPlpUohwO4sEL3IVs6dnSdX/joE6Zw==","shasum":"8517da6aec230eb4b6e40d849441c948f5708983","tarball":"https://registry.npmjs.org/@anura-gate/watcher-gmail/-/watcher-gmail-0.4.0.tgz","fileCount":8,"unpackedSize":53232,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF1sOig82aMBK+1+aDGJD+RErqr1+R5a0mRRGHHk32+CAiEA8lXPgKXohGRD9JTx/ulWMkMMlyzo8DL/+hO80Mpft1I="}]},"_npmUser":{"name":"anuragate","email":"ahmadajmal1514@gmail.com"},"directories":{},"maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/watcher-gmail_0.4.0_1772353006995_0.025437384748657976"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T11:13:52.087Z","modified":"2026-03-01T08:16:47.289Z","0.1.0":"2026-02-19T11:13:52.344Z","0.2.0":"2026-03-01T05:34:05.237Z","0.4.0":"2026-03-01T08:16:47.164Z"},"license":"MIT","keywords":["gate","watcher","gmail","email","self-hosted"],"description":"GATE Watcher — Self-hosted Gmail monitor. Credentials never leave your machine.","maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"readme":"# GATE Watcher — Gmail\n\nSelf-hosted daemon that monitors your Gmail inbox via IMAP and pushes mail events to GATE cloud for security processing. **Your email credentials never leave your machine.**\n\n## How it works\n\n```\nYour Machine (Watcher)              GATE Cloud\n┌─────────────────────┐        ┌──────────────────┐\n│ Gmail IMAP session  │───────>│ Security pipeline │\n│ (credentials HERE)  │<───────│ (redact, policy,  │\n│                     │ poll   │  audit, forward)  │\n└─────────────────────┘        └──────────────────┘\n```\n\n## Quick Start (CLI)\n\n```bash\ncd gate-watcher-gmail\nnpm install\n\n# Create .env (or pass env vars directly)\ncp .env.example .env\n# Fill in GATE_KEY, GATE_INTEGRATION_ID, GMAIL_EMAIL, GMAIL_APP_PASSWORD\n\nnpm start\n```\n\n## Embed in Your App (SDK)\n\n```bash\nnpm install @anura-gate/watcher-gmail\n```\n\n```js\nconst { GateGmailWatcher } = require(\"@anura-gate/watcher-gmail\");\n\nconst watcher = new GateGmailWatcher({\n  gateKey: \"gk-xxx\",\n  integrationId: \"int_xxx\",\n  email: \"you@gmail.com\",\n  appPassword: \"xxxx xxxx xxxx xxxx\",\n});\n\nwatcher.on(\"ready\", (email) => {\n  console.log(`Gmail connected: ${email}`);\n});\n\n// Every new email after GATE security processing\nwatcher.on(\"mail\", (event, result) => {\n  console.log(`From: ${event.from}, Subject: ${event.subject}`);\n  console.log(`Security actions: ${result.securityActions}`);\n  console.log(`Blocked: ${result.blocked}`);\n});\n\nwatcher.on(\"action_result\", ({ action, success, error }) => {\n  console.log(`${action}: ${success ? \"done\" : error}`);\n});\n\nawait watcher.start();\n\n// Later...\nawait watcher.stop();\n```\n\n## SDK Events\n\n| Event | Args | Description |\n|---|---|---|\n| `ready` | `(email)` | Connected to Gmail IMAP |\n| `mail` | `(event, result)` | New email processed by GATE |\n| `action` | `(action)` | Outbound action received from GATE queue |\n| `action_result` | `({ actionId, action, success, result, error })` | Outbound action completed |\n| `gate_error` | `({ path, status, error })` | GATE API call failed |\n| `limit_reached` | `(type)` | Plan limit hit |\n| `disconnected` | `(reason)` | IMAP disconnected |\n| `stopped` | — | Watcher fully shut down |\n\n## SDK Options\n\n| Option | Required | Default | Description |\n|---|---|---|---|\n| `gateKey` | Yes | — | Virtual key (`gk-xxx`) |\n| `integrationId` | Yes | — | Integration ID (`int_xxx`) |\n| `email` | Yes | — | Gmail address |\n| `appPassword` | Yes | — | Google App Password (16-char) |\n| `gateUrl` | No | `\"https://anuragate.com\"` | GATE cloud URL |\n| `host` | No | `\"imap.gmail.com\"` | IMAP host |\n| `port` | No | `993` | IMAP port |\n| `pollInterval` | No | `30000` | ms between mail polls |\n| `heartbeatInterval` | No | `30000` | ms between heartbeats |\n| `sessionId` | No | — | Session ID for multi-tenant use |\n| `sessionLabel` | No | — | Human-readable session label |\n| `sessionMetadata` | No | `{}` | Arbitrary metadata for the session |\n\n## Setup\n\n1. Enable **2-Step Verification** on your Google account\n2. Go to [myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords)\n3. Generate an App Password for \"Mail\" → copy the 16-character code\n4. Go to **GATE Dashboard → Integrations → Add Integration**\n5. Select **Gmail**, copy the **Integration ID**\n6. Copy your **Virtual Key** from the **Keys** page\n7. Set the env vars and run\n\n## Environment Variables\n\n| Variable | Required | Description |\n|---|---|---|\n| `GATE_KEY` | Yes | Your GATE virtual key |\n| `GATE_INTEGRATION_ID` | Yes | Integration ID from the dashboard |\n| `GMAIL_EMAIL` | Yes | Your Gmail address |\n| `GMAIL_APP_PASSWORD` | Yes | 16-character Google App Password |\n| `GATE_URL` | No | Custom GATE cloud URL |\n| `WEB_PORT` | No | Port for the dev dashboard (CLI only) |\n\n## Security model\n\n- Gmail App Password stored in `.env` on YOUR machine\n- GATE cloud never sees or stores your credentials\n- All email content passes through GATE's security pipeline\n- Billing, limits, and security enforced server-side\n","readmeFilename":"README.md","homepage":"https://anuragate.com","repository":{"type":"git","url":"git+https://github.com/ahmad-ajmal/AnuraGate_Sample.git"},"bugs":{"url":"https://github.com/ahmad-ajmal/AnuraGate_Sample/issues"}}