Skip to content
Nylas components are currently in private preview. They might contain bugs or errors, and might change considerably before they reach general availability (GA).

CalendarSync component

The CalendarSync component lets users enable or disable automatic Notetaker scheduling for their calendar events. Typically, you would use it on settings or integration pages where users manage how Notetaker joins meetings.

You need to set up a provider before you can use the CalendarSync component.

Using the CalendarSync component

import React, { useEffect } from "react";
import { CalendarSync, provider as useProvider } from "@nylas/react";
// import '@nylas/react/style.css' // to style the component
function App() {
const provider = useProvider();
useEffect(() => {
// Necessary to set before using the component
provider.setAccessToken("nylas-access-token");
provider.setApiUrl("eu"); // can be "us" or "eu", defaults to "us"
}, []);
return (
<CalendarSync
calendarId="example-calendar-id"
grantId="example-grant-id"
notetakerName="Example Notetaker"
onUpdate={(calendar) => console.log("Updated calendar:", calendar)}
onCancel={() => console.log("Edit cancelled")}
onError={(err) => console.error("Error:", err)}
hideRecordingSettings={false}
hideNameInput={false}
/>
);
}
export default App;

CalendarSync properties

PropertyTypeDescription
calendarIdstringThe ID of the calendar to sync with.
onSync?(event: SyncEvent) => voidA callback generated when the sync status changes.
autoSync?booleanAutomatically sync on mount.
className?stringAdditional CSS classes for the container.

SyncEvent

PropertyTypeDescription
status'syncing' | 'success' | 'error'The current sync status.
error?stringThe error message generated if sync fails.
timestampstringWhen the sync event occurred.

calendarSyncStore

This interface describes a Zustand store, an advanced state management React solution. This is intended for advanced use only – the Notetaker components will work without using this store directly.

The interface for the CalendarSync component state store. calendarSyncStore manages all form data and UI state information for the component.

import { calendarSyncStore, CalendarSync } from "@nylas/react"
export default function App() {
const store = calendarSyncStore();
useEffect(() => {
store.setName("ExampleName")
}, [])
return (
<div>
<CalendarSync />
</div>
)
}

calendarSyncStore properties

advancedSettings

DescriptionDisplay the Advanced Settings section.
Typeboolean
Defaultfalse

calendar

DescriptionThe synced calendar.
Typenull | Calendar

getCalendar

DescriptionFetches calendar data from the Nylas Calendar API.
Type(calendarId: string, grantId: string, fallbackNotetakerName?: string) => Promise<void>

handleCancel

DescriptionCancels changes and resets to original values.
Type(notetakerName?: string, onCancelCallback?: () => ...) => void

handleDisable

DescriptionDisables Notetaker for the synced calendar.
Type(calendarId: string, grantId: string, fallbackNotetakerName?: string,
onUpdate?: (data: ...) => ..., onError?: (error: ...) => ...,
onCancel?: () => ...) => Promise<void>

handleSave

DescriptionSaves Notetaker settings for the synced calendar.
Type(calendarId: string, grantId: string, onUpdate?: (data: ...) => ...,
onError?: (error: ...) => ...) => Promise<void>

hasChanges

DescriptionIndicates that the user made changes.
Typeboolean
Defaultfalse

isLoading

DescriptionIndicates that the component is loading.
Typeboolean
Defaultfalse

name

DescriptionThe name for the calendar sync.
Typestring

reset

DescriptionResets the store and all form fields to their default values.
Type() => void

selectedFilters

DescriptionA list of selected meeting filters.
TypeMeetingFilter[]

selectedRecordingTypes

DescriptionA list of selected recording types (video, audio, or transcript).
TypeRecordingType[]

setAdvancedSettings

DescriptionSets the visibility of the Advanced Settings section.
Type(show: boolean) => void

setCalendar

DescriptionSets the calendar.
Type(calendar: null | Calendar) => void

setHasChanges

DescriptionSets whether the user made changes.
Type(hasChanges: boolean) => void

setIsLoading

DescriptionSets the loading state.
Type(isLoading: boolean) => void

setName

DescriptionSets the name for the calendar sync.
Type(name: string) => void

setSelectedFilters

DescriptionSets the selected meeting filters.
Type(filters: MeetingFilter[]) => void

setSelectedRecordingTypes

DescriptionSets the selected recording types.
Type(types: RecordingType[]) => void

toggleMeetingFilter

DescriptionToggles the specified meeting filter on or off.
Type(filter: MeetingFilter) => void

toggleRecordingType

DescriptionToggles the specified recording type on or off.
Type(type: RecordingType) => void