{"_id":"@databridger/gmail","name":"@databridger/gmail","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@databridger/gmail","version":"0.1.0","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"exports":{".":{"require":"./dist/index.js","import":"./dist/index.js","types":"./dist/index.d.ts"}},"license":"Apache-2.0","dependencies":{"googleapis":"^148.0.0","@databridger/core":"0.1.0"},"devDependencies":{"typescript":"^5.0.0"},"scripts":{"build":"tsc --project tsconfig.json"},"_id":"@databridger/gmail@0.1.0","description":"Follow these steps to set up the Gmail API for the DataBridger project:","_integrity":"sha512-Fvxiq6cuO35ZEz1V/Mbcs7lZyQsKH43mJ0VKVZ4tQv69CvduFlcKwuc4YgqxE9KGW9mRKxxm7/eoLrm7hOC11A==","_resolved":"/private/var/folders/r5/l4hbd0nj3xv9_4k5tqppnsg00000gn/T/ac0fb9de1fae07373cc7f095bb6c3671/databridger-gmail-0.1.0.tgz","_from":"file:databridger-gmail-0.1.0.tgz","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-Fvxiq6cuO35ZEz1V/Mbcs7lZyQsKH43mJ0VKVZ4tQv69CvduFlcKwuc4YgqxE9KGW9mRKxxm7/eoLrm7hOC11A==","shasum":"4763fb2fc86be6a247ac7573283d7bbffdc111c2","tarball":"https://registry.npmjs.org/@databridger/gmail/-/gmail-0.1.0.tgz","fileCount":5,"unpackedSize":17563,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCSVk+W/4JUQvV9zqqahVnNiV7K4Xxza/Lz9JWDioFmDQIgegNz0z5tpL6ZF8MQiAjJN7SgytPWCbbJNCYO5k1QbQk="}]},"_npmUser":{"name":"masadow","email":"jimmy.delas@gmail.com"},"directories":{},"maintainers":[{"name":"masadow","email":"jimmy.delas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gmail_0.1.0_1747782713597_0.37678782187172666"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-20T23:11:53.481Z","0.1.0":"2025-05-20T23:11:53.842Z","modified":"2025-05-20T23:11:54.137Z"},"maintainers":[{"name":"masadow","email":"jimmy.delas@gmail.com"}],"description":"Follow these steps to set up the Gmail API for the DataBridger project:","license":"Apache-2.0","readme":"# Setting Up Gmail API in DataBridger\n\nFollow these steps to set up the Gmail API for the DataBridger project:\n\n## Prerequisites\n1. Ensure you have a Google Cloud account.\n2. Install the [Google Client Library for Node.js](https://github.com/googleapis/google-api-nodejs-client).\n\n## Steps\n1. **Enable the Gmail API**:\n  - Go to the [Google Cloud Console](https://console.cloud.google.com/).\n  - Create a new project or select an existing one.\n  - Navigate to **APIs & Services > Library**.\n  - Search for \"Gmail API\" and click **Enable**.\n\n2. **Create Credentials**:\n  - Go to **APIs & Services > Credentials**.\n  - Click **Create Credentials** and select **OAuth 2.0 Client IDs**.\n  - Configure the consent screen and download the `credentials.json` file.\n\n3. **Set Up Environment**:\n  - Place the `credentials.json` file in the root of your project.\n  - Add the following environment variables to your `.env` file:\n    ```env\n    GMAIL_CLIENT_ID=<your-client-id>\n    GMAIL_CLIENT_SECRET=<your-client-secret>\n    GMAIL_REDIRECT_URI=<your-redirect-uri>\n    GMAIL_REFRESH_TOKEN=<your-refresh-token>\n    ```\n\n4. **Authenticate and Test**:\n  - Use the Google Client Library to authenticate and test the Gmail API.\n  - Refer to the [Gmail API Documentation](https://developers.google.com/gmail/api) for detailed usage.\n\n## Example Code\n```javascript\nconst { google } = require('googleapis');\nconst oauth2Client = new google.auth.OAuth2(\n  process.env.GMAIL_CLIENT_ID,\n  process.env.GMAIL_CLIENT_SECRET,\n  process.env.GMAIL_REDIRECT_URI\n);\n\n// Set credentials\noauth2Client.setCredentials({ refresh_token: process.env.GMAIL_REFRESH_TOKEN });\n\nconst gmail = google.gmail({ version: 'v1', auth: oauth2Client });\n\n// Example: List messages\nasync function listMessages() {\n  const res = await gmail.users.messages.list({ userId: 'me' });\n  console.log(res.data);\n}\n\nlistMessages().catch(console.error);\n```\n\n## Notes\n- Ensure your `credentials.json` file is not exposed in version control.\n- For production, securely manage your environment variables.\n","readmeFilename":"README.md","_rev":"1-8aeb724d53a5e0177bff28b334134cf2"}