gmeet-link-generator
v1.0.8
Published
Generate Google Meet links, schedule meetings, and send email invites — without touching Google's raw API
Maintainers
Readme
gmeet-link-generator
Schedule a Google Meet and email the invite link — in a few lines of Node.js.
npm install gmeet-link-generator dotenvServer-side only. Never call this from frontend code — your tokens must stay on the server.
What it does
- Creates a Google Calendar event with a Meet link attached
- Emails the invite link to your attendees via your chosen email provider
Folder structure
my-app/
├── src/
│ ├── index.js ← your main script
│ └── testLink.js ← smoke test, run this first
├── .env ← secrets (never commit this)
├── .gitignore
├── package.json
└── README.md.env file
# Google OAuth — required
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
GOOGLE_REFRESH_TOKEN=1//xxxxxxxxxxxxxxxxxxxxxxx
# Add only the email provider you're using (pick one below)
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxx
# or
[email protected]
GMAIL_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
# or
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxAdd .env to your .gitignore — never commit real credentials.
node_modules/
.envStep 1 — Smoke test (run this first)
Confirms your Google credentials work before adding email.
Save as src/testLink.js and run node src/testLink.js.
require("dotenv").config();
const { createMeetLink, formatToISO, TIMEZONES } = require("gmeet-link-generator");
async function main() {
const meetLink = await createMeetLink({
auth: {
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
refreshToken: process.env.GOOGLE_REFRESH_TOKEN,
},
summary: "Test Meeting",
startTime: formatToISO("2025-11-22", "15:00", "+05:30"),
endTime: formatToISO("2025-11-22", "16:00", "+05:30"),
timeZone: TIMEZONES.INDIA,
});
console.log(meetLink
? "✅ Works! Meet link: " + meetLink
: "❌ Null — check your credentials"
);
}
main().catch(err => console.error("❌", err.message));Expected output:
✅ Works! Meet link: https://meet.google.com/abc-defg-hijStep 2 — Full example (Meet + email)
require("dotenv").config();
const {
scheduleMeeting,
sendEmailInvite,
formatToISO,
TIMEZONES,
resendConfig, // swap for gmailConfig or sendgridConfig
} = require("gmeet-link-generator");
async function main() {
// 1. Create the Google Calendar event + Meet link
const { meetLink } = await scheduleMeeting({
auth: {
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
refreshToken: process.env.GOOGLE_REFRESH_TOKEN,
},
summary: "Team Sync",
startTime: formatToISO("2025-11-22", "15:00", "+05:30"),
endTime: formatToISO("2025-11-22", "16:00", "+05:30"),
attendees: ["[email protected]"],
timeZone: TIMEZONES.INDIA,
});
// 2. Send the invite email
await sendEmailInvite({
to: "[email protected]",
subject: "You're invited: Team Sync",
text: "Looking forward to it!",
meetLink,
hostName: "Your Name",
smtpConfig: resendConfig(process.env.RESEND_API_KEY, "[email protected]"),
});
console.log("✅ Done:", meetLink);
}
main().catch(console.error);Email providers
Option A — Resend ✅ Recommended
Free tier: 3,000 emails/month. No credit card required. Purpose-built for developers.
Setup:
- Sign up free at resend.com
- Go to API Keys → Create API Key → copy to
.env - Use
[email protected]as sender while testing (no domain setup needed)
const { resendConfig } = require("gmeet-link-generator");
smtpConfig: resendConfig(process.env.RESEND_API_KEY, "[email protected]")Option B — Gmail (testing only)
⚠️ 500 emails/day limit. Google may suspend accounts used for bulk sending. Use for local testing only.
Setup:
- Go to myaccount.google.com/security
- Enable 2-Step Verification
- Search "App Passwords" → generate one → select Mail
- Copy the 16-character password (not your real password) to
.env
const { gmailConfig } = require("gmeet-link-generator");
smtpConfig: gmailConfig(process.env.GMAIL_USER, process.env.GMAIL_APP_PASSWORD)Option C — SendGrid
Free tier: 100 emails/day. Good for enterprise integrations.
Setup:
- Sign up at sendgrid.com
- Settings → API Keys → Create → Restricted Access → Mail Send → Full Access
- Settings → Sender Authentication → verify your sender email
const { sendgridConfig } = require("gmeet-link-generator");
smtpConfig: sendgridConfig(process.env.SENDGRID_API_KEY)Security
- Never hardcode credentials — always use
process.env - Never call this package from frontend code — keep tokens on your server
- Add
.envto your.gitignorebefore your first commit
License
MIT
