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 🙏

© 2026 – Pkg Stats / Ryan Hefner

calendar-notes-plugin

v1.0.31

Published

Embeddable calendar notes plugin

Readme

Calendar Notes Widget

A lightweight embeddable calendar + personal notes widget that can be integrated into any website. Users can:

  • View a calendar.
  • Create personal notes for specific dates.
  • Set reminders.
  • Store notes securely in Supabase.
  • Keep notes private per user.

The widget is designed to be embedded via a simple script tag and integrated with the host website's authentication system.


✨ Features

  • Interactive calendar.
  • view / Add / update / delete notes.
  • Reminder support.
  • Supabase database storage.
  • User-based note isolation.
  • Lightweight embeddable widget.
  • Easy integration with existing websites.
  • Works with any framework (Angular, React, Vue, Vanilla JS).

Installation

CDN (Recommended)

Add the widget script to your website.

 <script src="http://localhost:4200/widget.js"></script>

Quick Start

  1. Include the widget script.
<script src="widget.js"></script>
  1. Configure the widget.
window.CalendarNotesConfig = {
  loadNotes: async () => { },
  saveNote: async (note) => { },
  updateNote: async (note) => { },
  deleteNote: async (id) => { }
};
  1. The widget will automatically load on the page.

Host Website Integration

The host website must provide four functions to interact with the database. These functions allow the widget to remain backend-agnostic. Example configuration:

window.CalendarNotesConfig = {

  loadNotes: async () => {
    if (!window.currentUserId) return [];
    const { data } =
      await supabaseService.getNotes(window.currentUserId);
    return data || [];
  },

  saveNote: async (note) => {
    note.user_id = window.currentUserId;
    const { data } =
      await supabaseService.saveNote([note]);
    return data?.[0];
  },

  updateNote: async (note) => {
    const { data } =
      await supabaseService.updateNote(note.id, note);
    return data?.[0];
  },



  deleteNote: async (id) => {
    await supabaseService.deleteNote(id);
  }

};

User Authentication Integration

When a user logs in, the host website must notify the plugin.
Example:

window.currentUserId = userId;

window.postMessage(
  { type: "USER_LOGIN", userId: userId },
  "*"
);

This allows the widget to load user-specific notes.


☁️ Supabase Integration

The widget does not directly access Supabase. Instead, the host website handles Supabase communication. Example Supabase service:

const { data } = await supabase
  .from("notes")
  .select("*")
  .eq("user_id", userId);

🗄 Database Schema

Create a notes table in Supabase.

| Column | Type | Description | |------------|----------|---------------| | id | uuid | Primary key | | user_id | uuid | User ID | | title | text | Note title | | content | text | Note content | | note_date | date | Note date | | created_at | timestamp| Created time | | reminder_at| timestamp| Reminder time |


🔒 Row Level Security Policies

Enable Row Level Security.

alter table notes enable row level security;

Policy example: Select policy

CREATE POLICY "Users can view their notes"
ON notes
FOR SELECT

Insert policy

CREATE POLICY "Users can insert notes"
ON notes
FOR INSERT
WITH CHECK (auth.uid() = user_id);

Update policy

CREATE POLICY "Users can update their notes"
ON notes
FOR UPDATE
USING (auth.uid() = user_id);

Delete policy

CREATE POLICY "Users can delete their notes"
ON notes
FOR DELETE
USING (auth.uid() = user_id);

📡 API Reference

The plugin expects the following configuration API.

  1. loadNotes()

Fetch notes for the logged-in user.

Returns:

Array<Note>

  1. saveNote(note)

Create a new note.

Example note:

{
  title: "Exam preparation",
  content: "Study chapter 3",
  note_date: "2026-03-14"
}

Returns:

Note


  1. updateNote(note)

Update an existing note.

Requires:

note.id


  1. deleteNote(id)

Delete a note.

Parameter:

noteId


📄 Note Object Structure

{
  id: string
  user_id: string
  title: string
  content?: string
  note_date: string
  reminder_at?: string
}

Usage Example

Example login integration.

async login() {

  const { data } =
    await supabase.auth.signInWithPassword({
      email,
      password
    });

  const userId = data.user.id;

  window.currentUserId = userId;

  window.postMessage({
    type: "USER_LOGIN",
    userId: userId
  });

}

🛠 Troubleshooting

Notes not loading Check:

CalendarNotesConfig.loadNotes

Notes not saving Verify: currentUserId is set


Supabase permission errors Check: Row Level Security policies


❓ FAQ

Does the plugin require Supabase? No. You can connect it to any backend as long as the required functions are implemented.


Can multiple users use the plugin? Yes. Each user's notes are isolated using user_id.


Can this plugin work with React or Vue? Yes. It works with any framework because it uses a simple script tag.


👨‍💻 Author

Developed by Vidunaya Technologies