@sindhu-3112/meet-scheduler
v1.0.1
Published
Generate Google Meet links, schedule meetings, and send email invites — without touching Google's raw API
Downloads
196
Maintainers
Readme
@sindhu-3112/meet-scheduler
Schedule Google Meet meetings and send email invites — in 5 lines of code.
npm install @sindhu-3112/meet-schedulerHow email works in this package
Your credentials are never hardcoded. You bring your own email provider.
This means your Gmail (or any other account) is never at risk.
The package supports three providers out of the box:
| Provider | Best for | Free limit | Setup time | |---|---|---|---| | Gmail | Local testing only | 500/day | 3 mins | | Resend | Production (recommended) | 3,000/month | 2 mins | | SendGrid | Enterprise | 100/day | 5 mins |
Quick start
const {
scheduleMeeting,
sendEmailInvite,
formatToISO,
TIMEZONES,
resendConfig, // ← import your chosen provider helper
} = require("@sindhu-3112/meet-scheduler");
// 1. Schedule the meeting
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]"),
});Email provider setup
Option A — Gmail (testing only)
⚠️ Gmail has a 500 email/day limit and Google can suspend your account for bulk sending. Use only for local testing.
Steps:
- Go to https://myaccount.google.com/security
- Turn on 2-Step Verification (required)
- Search "App Passwords" → Generate one → select Mail
- Copy the 16-character password
const { gmailConfig } = require("@sindhu3112/meet-scheduler");
const smtpConfig = gmailConfig(
process.env.GMAIL_USER, // your Gmail address
process.env.GMAIL_APP_PASSWORD // 16-char App Password (NOT your real password)
);.env:
[email protected]
GMAIL_APP_PASSWORD=xxxx-xxxx-xxxx-xxxxOption B — Resend ✅ Recommended
Free tier: 3,000 emails/month. No credit card. Purpose-built for developers.
Steps:
- Sign up free at https://resend.com
- Go to API Keys → Create API Key → copy it
- To send from your own domain: go to Domains → Add Domain and follow the DNS steps (optional but professional)
- While testing, you can use
[email protected]as the from address (no domain needed)
const { resendConfig } = require("@sindhu-3112/meet-scheduler");
const smtpConfig = resendConfig(
process.env.RESEND_API_KEY,
"[email protected]" // or "[email protected]" while testing
);.env:
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxOption C — SendGrid
Free tier: 100 emails/day. Good for enterprise integrations.
Steps:
- Sign up at https://sendgrid.com
- Go to Settings → API Keys → Create API Key
- Restricted Access → Mail Send → Full Access
- Go to Settings → Sender Authentication → Single Sender Verification
- Verify the email address you'll send from
const { sendgridConfig } = require("@sindhu-3112/meet-scheduler");
const smtpConfig = sendgridConfig(process.env.SENDGRID_API_KEY);.env:
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxOption D — Custom SMTP (any provider)
If you use Mailgun, Postmark, AWS SES, or your own SMTP server, pass the config directly:
await sendEmailInvite({
to: "[email protected]",
subject: "Meeting Invite",
text: "Join below",
meetLink,
smtpConfig: {
host: "smtp.mailgun.org",
port: 465,
secure: true,
auth: {
user: process.env.MAILGUN_USER,
pass: process.env.MAILGUN_PASS,
},
},
});Any Nodemailer-compatible transport works.
Full API reference
scheduleMeeting(options) → { meetLink, eventId, htmlLink }
| Option | Type | Required | Default |
|---|---|---|---|
| auth.clientId | string | ✅ | — |
| auth.clientSecret | string | ✅ | — |
| auth.refreshToken | string | ✅ | — |
| summary | string | ✅ | — |
| startTime | string | ✅ | ISO 8601 |
| endTime | string | ✅ | ISO 8601 |
| description | string | | "" |
| attendees | string[] | | [] |
| timeZone | string | | "Asia/Kolkata" |
| sendUpdates | boolean | | true |
createMeetLink(options) → string
Same as scheduleMeeting but returns just the Meet URL.
sendEmailInvite(options) → { messageId, accepted }
| Option | Type | Required |
|---|---|---|
| to | string | string[] | ✅ |
| subject | string | ✅ |
| text | string | ✅ |
| meetLink | string | ✅ |
| smtpConfig | object | ✅ |
| hostName | string | |
formatToISO(date, time, offset?) → string
formatToISO("2025-11-22", "15:00") // "2025-11-22T15:00:00+05:30"
formatToISO("2025-11-22", "15:00", "-08:00") // "2025-11-22T15:00:00-08:00"TIMEZONES
TIMEZONES.INDIA // "Asia/Kolkata"
TIMEZONES.UTC // "UTC"
TIMEZONES.NEW_YORK // "America/New_York"
TIMEZONES.LONDON // "Europe/London"
TIMEZONES.DUBAI // "Asia/Dubai"
TIMEZONES.SINGAPORE // "Asia/Singapore"
TIMEZONES.TOKYO // "Asia/Tokyo"
TIMEZONES.SYDNEY // "Australia/Sydney"Security rules
- Never hardcode credentials — always use environment variables
- Never call this package from the frontend — keep auth tokens on your server
- Add
.envto your.gitignore
Publish to npm
# 1. Update "name" in package.json → @yournpmname/meet-scheduler
npm login
npm publish --access publicLicense
MIT
