npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@marek-knappe/node-red-google-calendar

v3.1.2

Published

Enhanced Google Calendar nodes for Node-RED with improved error handling, event links, and authentication. Based on @platmac/node-red-google-calendar with significant improvements.

Downloads

80

Readme

Node-RED Google Calendar Enhanced

npm version License Node-RED

Enhanced Google Calendar nodes for Node-RED with improved error handling, event links, delete functionality, and robust OAuth2 authentication.

Note: This package is based on the original work by @platmac/node-red-google-calendar with significant improvements and enhancements.

✨ Features

  • 📅 Complete Calendar Operations: Create, read, update, and delete Google Calendar events
  • 🔗 Event Links: Direct links to calendar events and Google Meet video calls
  • 🛡️ Robust Error Handling: Comprehensive error responses with detailed debugging information
  • 🔐 Enhanced Authentication: Improved OAuth2 token refresh and management
  • 📧 Attendee Management: Support for event attendees and notifications
  • 🎥 Google Meet Integration: Automatic conference creation with video links
  • 🌍 Timezone Support: Proper timezone handling for global events

🚀 What's New in v3.0.1

  • NEW: deleteEvent node for removing calendar events
  • IMPROVED: Enhanced error handling across all modules
  • FIXED: OAuth2 token refresh issues causing 401 errors
  • ADDED: Event links (EventLink and MeetLink) in all responses
  • ENHANCED: Proactive token management with expiry buffering

📦 Installation

Via Node-RED Palette Manager (Recommended)

  1. Open Node-RED
  2. Go to Manage PaletteInstall
  3. Search for @marek-knappe/node-red-google-calendar
  4. Click Install

Via npm

npm install @marek-knappe/node-red-google-calendar

🔧 Setup & Configuration

1. Google Calendar API Setup

  1. Create Google Cloud Project

  2. Enable Google Calendar API

    • Go to APIs & ServicesLibrary
    • Search for "Google Calendar API"
    • Click Enable
  3. Create OAuth 2.0 Credentials

    • Go to APIs & ServicesCredentials
    • Click Create CredentialsOAuth 2.0 Client IDs
    • Choose Web application
    • Add authorized redirect URIs (shown in Node-RED)

2. Node-RED Configuration

  1. Add Calendar Node

    • Drag any Google Calendar node to your flow
    • Click Edit on the Google Account field
  2. Enter Credentials

    • Client ID: From Google Cloud Console
    • Client Secret: From Google Cloud Console
  3. Authenticate

    • Click Authenticate with Google
    • Grant permissions in browser
    • Click Add to complete setup

📋 Available Nodes

🔍 Get Event

Retrieves events from Google Calendar within a specified time range.

Input Properties:

  • msg.payload.timemin - Start time (e.g., "2024-01-01 09:00:00")
  • msg.payload.timemax - End time (e.g., "2024-01-01 17:00:00")
  • msg.calendarId - Calendar ID (e.g., "[email protected]")

Output Properties:

  • msg.payload - Array of event objects
  • msg.eventId - Event identifier
  • msg.calendarId - Calendar ID
  • msg.start - Event start time
  • msg.end - Event end time
  • msg.title - Event title
  • msg.attendees - List of attendees
  • msg.EventLink - Direct link to calendar event
  • msg.MeetLink - Google Meet video call link

➕ Add Event

Creates new events in Google Calendar.

Input Properties:

  • msg.calendarId - Target calendar ID
  • msg.title - Event title
  • msg.description - Event description
  • msg.location - Event location
  • msg.start - Start time
  • msg.end - End time
  • msg.timezone - Timezone offset
  • msg.conference - Enable Google Meet

Output Properties:

  • msg.payload - Success/Error message
  • msg.eventId - Created event ID
  • msg.meetLink - Google Meet link (if enabled)
  • msg.eventLink - Direct calendar event link
  • msg.success - Boolean success flag

✏️ Update Event

Modifies existing calendar events.

Input Properties:

  • msg.calendarId - Calendar ID
  • msg.eventId - Event ID to update
  • msg.title - New title
  • msg.description - New description
  • msg.location - New location
  • msg.conference - Enable/disable Google Meet
  • msg.emailNotify - Notify attendees of changes

Output Properties:

  • msg.payload - Success/Error message
  • msg.thisEventId - Updated event ID
  • msg.meetLink - Google Meet link
  • msg.eventLink - Direct calendar event link
  • msg.success - Boolean success flag

🗑️ Delete Event

Removes events from Google Calendar.

Input Properties:

  • msg.calendarId - Calendar ID
  • msg.eventId - Event ID to delete
  • msg.emailNotify - Notify attendees of deletion

Output Properties:

  • msg.payload - Success/Error message
  • msg.eventId - Deleted event ID
  • msg.calendarId - Calendar ID
  • msg.success - Boolean success flag

💡 Use Cases

🤖 Automated Meeting Reminders

// Get upcoming meetings and send reminders
const events = await getEvents({ timemin: "now", timemax: "+1h" });
events.forEach(event => {
    if (event.attendees.length > 0) {
        sendReminder(event.title, event.EventLink, event.attendees);
    }
});

🏢 Room Booking System

// Check room availability and book
const availability = await getEvents({ 
    calendarId: "[email protected]",
    timemin: "2024-01-15 09:00:00",
    timemax: "2024-01-15 10:00:00"
});

if (availability.length === 0) {
    await addEvent({
        calendarId: "[email protected]",
        title: "Team Meeting",
        start: "2024-01-15 09:00:00",
        end: "2024-01-15 10:00:00"
    });
}

📅 Daily Agenda Notifications

// Send daily agenda to team
const today = new Date().toISOString().split('T')[0];
const agenda = await getEvents({
    timemin: today + " 00:00:00",
    timemax: today + " 23:59:59"
});

const agendaText = agenda.map(event => 
    `${event.start} - ${event.title}`
).join('\n');

sendNotification("Today's Agenda", agendaText);

🏠 Smart Home Integration

// Trigger home automation based on calendar events
const events = await getEvents({ timemin: "now", timemax: "+30m" });
events.forEach(event => {
    if (event.title.includes("Meeting")) {
        turnOnLights();
        adjustThermostat();
        sendNotification("Meeting starting soon", event.EventLink);
    }
});

🔍 Error Handling

All nodes provide comprehensive error handling with consistent response formats:

// Success response
{
    payload: "Successfully added event to calendar",
    success: true,
    eventId: "abc123",
    eventLink: "https://calendar.google.com/event/...",
    meetLink: "https://meet.google.com/..."
}

// Error response
{
    payload: "Failed to add event: HTTP Error: 400 - Invalid request",
    success: false,
    error: "HTTP Error: 400 - Invalid request",
    statusCode: 400
}

🛠️ Troubleshooting

Common Issues

401 Authentication Error

  • Tokens automatically refresh every 5 minutes
  • Check Google Cloud Console credentials
  • Ensure Calendar API is enabled

Calendar Not Found

  • Verify calendar ID format
  • Check calendar sharing permissions
  • Ensure OAuth scope includes calendar access

Event Creation Fails

  • Validate date/time formats
  • Check required fields (title, start, end)
  • Verify calendar write permissions

Debug Mode

Enable detailed logging in Node-RED settings to troubleshoot issues.

📚 Examples

See the examples/ folder for complete flow examples and screenshots.

🤝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🙏 Acknowledgments

  • Original Work: Based on @platmac/node-red-google-calendar by Hooke Jr.
  • Enhancements: Significant improvements by Marek Knappe
  • Community: Node-RED community for feedback and testing

📞 Support


Made with ❤️ for the Node-RED community