ios-calendar-export
v0.1.0
Published
Convert meeting data into an iCalendar (.ics) for adding to the iOS Calendar.
Readme
ios-calendar-export
Convert meeting data into an iCalendar (.ics) string and deliver it so a user
can add the meeting to their iOS Calendar. Isomorphic (browser / Node / React
Native), zero runtime dependencies, no network calls.
Install
npm install ios-calendar-exportUsage
import { createICS, downloadICS } from "ios-calendar-export";
const ics = createICS({
title: "Design review",
start: "2026-06-28T10:00:00Z", // ISO 8601 with offset, or a Date
end: "2026-06-28T11:00:00Z",
location: {
address: "Alexanderplatz 1, Berlin",
latitude: 52.52,
longitude: 13.405, // from Google Maps; link opens in Google Maps
},
alarms: [15], // remind 15 minutes before
});
// Browser: trigger a download — iOS Safari offers "Add to Calendar"
downloadICS(ics, "meeting.ics");Node (HTTP response)
import { createICS, toICSBytes, icsHttpHeaders } from "ios-calendar-export";
const ics = createICS(meeting);
res.writeHead(200, icsHttpHeaders("meeting.ics"));
res.end(toICSBytes(ics));React Native / data URI
import { createICS, toDataUri } from "ios-calendar-export";
const uri = toDataUri(createICS(meeting)); // open or share thisOnline meetings (Zoom / phone)
Use the conference field for a join link or a dial-in. type: "video" is for
a meeting URL (Zoom, Teams, Meet); type: "phone" is for a tel: number.
// Video call
createICS({
title: "Standup",
start: "2026-06-30T10:00:00+02:00",
end: "2026-06-30T10:30:00+02:00",
conference: {
type: "video",
url: "https://zoom.us/j/123456789?pwd=abc",
label: "Zoom",
},
});
// Phone call / dial-in
createICS({
title: "Client call",
start: "2026-06-30T15:00:00+02:00",
end: "2026-06-30T15:30:00+02:00",
conference: {
type: "phone",
url: "tel:+4930123456",
label: "Dial-in",
dialIn: "Access code: 4242#", // optional, shown in the notes
},
});Each conference emits an RFC 7986 CONFERENCE property and mirrors the link into
the notes, since Apple Calendar renders its "Join" button from a link in the
notes rather than from CONFERENCE. Keep the canonical event url and physical
location separate from conference.
Notes
- Datetimes must carry a timezone (ISO 8601 offset or a
Date); emitted as UTC. - The location link opens in Google Maps (Apple structured location is not used).
- Invalid input throws
MeetingValidationErrorwith acode.
