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

react-native-nitro-event-kit

v1.8.0

Published

react-native-nitro-event-kit

Readme

📅 React Native Nitro Event Kit npm version

🔹 React Native Nitro Event Kit enables seamless access to iOS calendar events in your React Native applications. Fetch local events efficiently using the power of Nitro Modules.


🚀 Features

  • 📆 Fetch Local Events: Retrieve all events from the user’s iOS calendar.
  • ⚡ Optimized Performance: Built with Nitro for low-latency event retrieval.
  • 🔒 Secure Access: Requires user permission for accessing calendar data.
  • 📱 Native iOS Integration: Fully leverages iOS CalendarKit for accurate data.

🛠️ Prerequisites

Before getting started, ensure you have:


📦 Installation

Run the following command to install the package:

npm install react-native-nitro-event-kit react-native-nitro-modules

yarn add react-native-nitro-event-kit react-native-nitro-modules

cd ios && pod install

Edit Info.plist. Add the following item (Set Value as desired):

| Key | Type | Value | | --------------------------------------- | -------- | ---------------------------------------------------------------------------------- | | Privacy - NSCalendarsUsageDescription | String | CHANGEME: This app requires access to your calendar to create and manage events. |

🎯 API Reference

📜 Permissions Statuses in React Native Nitro Event Kit

Permission checks and requests resolve into one of the following statuses:

| Return Value | Description | | --------------------- | ----------------------------------------------------------------------------- | | "unavailable" | This feature is not available on the current device or in this context. | | "denied" | The user has not granted permission, but it is requestable. | | "restricted" | The permission is restricted due to parental controls or device policies. | | "fullAccess" | The permission has been granted, and the app has full access to the calendar. | | "writeOnly" | The app can write to the calendar but cannot read existing events. | | "notDetermined" | The user has not been asked for permission yet. |

These statuses help determine whether the app can read, write, or modify calendar events. If the status is "denied" or "restricted", users must manually enable permissions in the device settings.

📌 Example Usage

✅ Checking Permission Status

To check the current status of calendar permissions, use:

import { NitroEventKitCalendarPermission } from 'react-native-nitro-event-kit';

const checkCalendarPermission = () => {
  const status = NitroEventKitCalendarPermission.getPermissionsStatus();
  console.log('Current permission status:', status);
};

🔄 Requesting Permission

To request calendar access from the user, use:

import { NitroEventKitCalendarPermission } from 'react-native-nitro-event-kit';

const requestCalendarPermission = async () => {
  try {
    const status = await NitroEventKitCalendarPermission.requestPermission();
    console.log('Updated permission status:', status);
  } catch (error) {
    console.error('Error requesting permission:', error);
  }
};

📆 Calendar Methods

Below are the methods available in React Native Nitro Event Kit, allowing you to interact with the iOS calendar system.


Get Active Calendars

Retrieves all active calendars available on the device.

NitroEventKit.getActiveCalendars(): Promise<EventKitCalendar[]>

📌 Example Usage

import { NitroEventKit } from 'react-native-nitro-event-kit';

const getActiveCalendars = async () => {
  try {
    const calendars = await NitroEventKit.getActiveCalendars();
    console.log('Active Calendars:', calendars);
  } catch (error) {
    console.error('Error fetching calendars:', error);
  }
};

Get Monthly Calendar Events

Fetches all calendar events for the current month.

NitroEventKit.getMonthlyCalendarEvents(entityType: EventKitEntityType): Promise<EventKitEvent[]>

📌 Example Usage

import {
  NitroEventKit,
  EventKitEntityType,
} from 'react-native-nitro-event-kit';

const getMonthlyEvents = async () => {
  try {
    const events = await NitroEventKit.getMonthlyCalendarEvents(
      EventKitEntityType.Event,
    );
    console.log('Monthly Events:', events);
  } catch (error) {
    console.error('Error fetching monthly events:', error);
  }
};

Get Events in Date Range

Fetches calendar events within a specific date range.

NitroEventKit.getCalendarEventsByRange(options: RangeEventOptions): Promise<EventKitEvent[]>

📌 Example Usage

import {
  NitroEventKit,
  EventKitEntityType,
} from 'react-native-nitro-event-kit';
import dayjs from 'dayjs';

const getEventsByRange = async () => {
  const options = {
    startDate: dayjs().startOf('month').valueOf(),
    endDate: dayjs().endOf('month').valueOf(),
    entityType: EventKitEntityType.Event,
  };

  try {
    const events = await NitroEventKit.getCalendarEventsByRange(options);
    console.log('Events in Range:', events);
  } catch (error) {
    console.error('Error fetching events in range:', error);
  }
};

Create a New Event

Creates a new event in the specified calendar.

NitroEventKit.createEvent(options: CreateEventOptions): Promise<EventKitEvent>

📌 Example Usage

import { NitroEventKit } from 'react-native-nitro-event-kit';
import dayjs from 'dayjs';

const createEvent = async () => {
  const eventOptions = {
    title: 'Meeting with Team',
    location: 'Office',
    notes: 'Discuss project updates',
    startDate: dayjs().add(1, 'hour').valueOf(),
    endDate: dayjs().add(2, 'hour').valueOf(),
    calendarIdentifier: '66C97F38-EB2B-4F6F-9E51-EEE42646A7BC',
    isCalendarImmutable: false,
    scheduleAlarmMinutesBefore: 10,
    scheduleAlarm: true,
  };

  try {
    const newEvent = await NitroEventKit.createEvent(eventOptions);
    console.log('Event Created:', newEvent);
  } catch (error) {
    console.error('Error creating event:', error);
  }
};

Delete an Event

Deletes an event by its event identifier.

NitroEventKit.deleteEvent(eventIdentifier: string): Promise<boolean>

📌 Example Usage

import { NitroEventKit } from 'react-native-nitro-event-kit';

const deleteEvent = async (eventId: string) => {
  try {
    const success = await NitroEventKit.deleteEvent(eventId);
    console.log(success ? 'Event Deleted' : 'Failed to Delete Event');
  } catch (error) {
    console.error('Error deleting event:', error);
  }
};

Open an Event in the iOS View Controller (WIP)

Opens a specific event in the native iOS Calendar app.

NitroEventKit.openCalendarEvent(eventIdentifier: string): Promise<void>

📌 Example Usage

import { NitroEventKit } from 'react-native-nitro-event-kit';

const openEventInCalendar = async (eventId: string) => {
  try {
    await NitroEventKit.openCalendarEvent(eventId);
    console.log('Calendar event opened successfully');
  } catch (error) {
    console.error('Error opening calendar event:', error);
  }
};