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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fdecourt/node-red-google-calendar-events

v0.0.2

Published

Hopefully secure and robust Node-RED node to retrieve Google Calendar events between dates

Downloads

30

Readme

Google Calendar Events Node for Node-RED

This repository provides a custom Node-RED node that allows you to connect to the Google Calendar API, retrieve events, and work with both full-day and timed events. The node offers an intuitive interface for selecting calendars and date ranges, with OAuth2 authentication to securely access your Google Calendar.


Features

  • OAuth2 Authentication: Secure integration with Google Calendar through OAuth2.
  • Retrieve Events: Fetch events between specific start and end dates.
  • Full-Day Event Support: Easily switch between full-day events and events with specific time ranges.
  • Dynamic Calendar List: Automatically loads available calendars and provides them in a dropdown.
  • Configurable UI in Node-RED: Easy to configure via the Node-RED editor.

Prerequisites

Before using this node, ensure you have:

  1. A Google Cloud Project with the Google Calendar API enabled.
  2. OAuth2 credentials (Client ID and Client Secret) created in the Google Cloud Console.
  3. Node-RED installed on your system.

Installation

In Node-RED (preferred)

Via Manage Palette -> Search for "@fdecourt/node-red-google-calendar-events"

In a shell

Basic installation:

go to the Node-RED "userDir" folder, typically ~/.node-red run npm install node-red-contrib-moment To get the latest development version, install with:

run npm install fdecourt/node-red-google-calendar-events

Configuration

Global Configuration Node: google-calendar-config

The google-calendar-config node is responsible for handling OAuth2 authentication with Google Calendar. This requires creating a project in the Google Cloud Console and obtaining OAuth2 credentials.

Setup Instructions:

  1. Go to the Google Cloud Console.
  2. Create a new Web App project and enable the Google Calendar API.
  3. Create OAuth 2.0 credentials by setting up a Client ID and Client Secret.
  4. In the Node-RED editor, the google-calendar-config node will generate a redirect URI. Copy this URI and add it to your Authorized Redirect URIs in the Google Cloud Console.
  5. Use the Client ID and Client Secret generated in Google Cloud Console and enter them in the google-calendar-config node in Node-RED.
  6. Click Authenticate with Google to start the OAuth2 process. Follow the prompts to authorize your Node-RED instance to access your Google Calendar.

Event Retrieval Node: google-calendar-events

This node retrieves events from your Google Calendar. Configure the following fields:

  • Calendar: This dropdown will be populated dynamically with your available Google Calendars once authentication is completed.
  • Start Date: The date and time from which you want to retrieve events.
  • End Date: The date and time until which you want to retrieve events.
  • Full-Day Events: If you want to retrieve full-day events, check the box. If unchecked, you will retrieve events within specific time frames.

Steps to Use:

  1. Drag the google-calendar-events node into your flow.
  2. Configure the node by adding a new Google Calendar Configuration
  3. Add the Client ID and Client Secret from your Google Cloud Console to the node's configuration.
  4. Click on Authenticate with Google to log in and authorize access to your Google Calendar.
  5. Select the calendar and set the date range (start and end dates).
  6. Deploy the flow and start retrieving events from your Google Calendar.

Advanced Configuration

Dynamic Parameter Override:

You can dynamically override parameters like calendar, start and end, using msg.calendar, msg.start, msg.end. be aware that the calendar you want to use must be identified by its ID (you can find it when opening the google-calendar-events node)

Important Notice

Authentication process with HomeAssistant

If using it with NodeRed as a plugin in HomeAssistant, you may need to reenter yoiur HomeAssistant Login / Password during the authorization process with Google Agenda.

Nginx Proxy Manager

If using NginxProxyManager (NPM), you may have to configure a specific location, to allow it to work :

  • NODERED_IP : this is the IP address of your NodeRed installation.
  • NODERED_PORT : this is the NodeRed port (if using through HomeAssistant, it is not the HomeAssistant Port, but the NodeRed one)

This one is working for me :

location /google-calendar/ {
    proxy_pass http://NODERED_IP:NODERED_PORT/google-calendar/; 
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_cache_bypass $http_upgrade;
}