Scheduler Editor Components

nylas-scheduler-editor

Overview

The nylas-scheduler-editor component is a form that allows users to configure the settings for the Nylas Scheduler.

Version1.1.0-canary.23
Install (React)npm install @nylas/react
Import (React)import { NylasSchedulerEditor } from '@nylas/react';

Example


Properties

PropertyAttributeDescriptionTypeDefault
additionalParticipantsThis prop is used to populate the additional participants and their availability in the scheduler editor.AdditionalParticipant[] | undefinedundefined
conferenceProvidersThis prop will be used to populate the conference provider options in the editor. The key is the provider name (‘zoom’) and the value is the grant id. We currently support same provider (‘google’, ‘microsoft’) for all participants and ‘zoom’ for cross-provider conferencing.undefined | { [x: string]: string; }undefined
configurationIdconfiguration-id* The configuration id to use for the scheduler editor. If provided, then the scheduler editor will try and fetch the configuration with the provided id. If found, it will automatically load the editor with the configuration settings for editing.string | undefinedundefined
defaultAuthArgsThe default authentication arguments to use when authenticating a user.AuthArgs[] | undefinedundefined
defaultSchedulerConfigStateThe default scheduler config store state. Used to set the initial state of the scheduler config store. This state can be used to pass defaults to newly created configurations.undefined | { selectedConfiguration?: RecursivePartial<Configuration> | undefined; configurations?: Configuration[] | undefined; calendars?: Calendar[] | undefined; currentUser?: User | null | undefined; action?: "create" | "edit" | null | undefined; additionalParticipants?: AdditionalParticipant[] | undefined; listConfigurationsNextCursor?: string | null | undefined; hideEditorTabs?: string[] | undefined; conferenceProviders?: Record<"google" | "microsoft" | "zoom", string> | undefined; eventReminders?: EventReminder[] | undefined; requiresSlug?: boolean | undefined; }undefined
eventOverridesThis provides a way to override the default event handlers.Partial<{ formSubmitted: (event: CustomEvent<void>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; schedulerConfigChanged: (event: CustomEvent<SchedulerEventDetail>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; cancelButtonClick: (event: CustomEvent<void>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; previewButtonClicked: (event: CustomEvent<HTMLNylasEditorTabsElement>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; schedulerEditorFormUpdated: (event: CustomEvent<{ value: string; name: string; }>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; initListConfigurations: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; cursor?: string | undefined; }>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; createButtonClick: (event: CustomEvent<HTMLNylasListConfigurationsElement>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; editButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; deleteButtonClick: (event: CustomEvent<{ host: HTMLNylasListConfigurationsElement; configuration: Configuration; }>, connector?: NylasSchedulerConfigConnectorInterface | undefined) => Promise<void>; }> & EventOverride<NylasSchedulerConfigConnectorInterface>{}
hideEditorTabsThis optional prop is used to hide tabs in the editor. Available tabs are: eventInfo, availability, participants, bookingOptions, bookingFormstring[] | undefined[]
modemodeThis is used to set the mode for the scheduler config. The mode can be ‘app’ or ‘composable’. The default mode is ‘app’."app" | "composable"'app'
nylasApiRequestThe Nylas Api Request instance. Used to make requests to the Nylas API.NylasApiRequest | undefinedundefined
nylasSessionsConfigThe Nylas Sessions configuration. Used to configure the Nylas Sessions instance.Config | undefinedundefined
requiresSlugrequires-slugIndicates if a slug is required for the configuration. When set to true, the user must enter a slug when creating or editing a configuration. The slug is used for hosted pages. If using Nylas hosted scheduling pages, the schedulerPreviewLink prop can be set to redirect to a public configuration as follows: https://book.nylas.com/us/<YOUR_NYLAS_APP_CLIENT_ID>/{slug}. us denotes the region. Replace it with the appropriate region of your application. Replace <YOUR_NYLAS_APP_CLIENT_ID> with your Nylas app client ID. The {slug} placeholder is replaced with the appropriate slug when the scheduler preview button is clicked. Note: Nylas hosted scheduling pages are only available for public configurations.booleanfalse
schedulerPreviewLinkscheduler-preview-linkThe scheduler preview link used when the user clicks the preview button. If requiresSlug is true, you can use the placeholder {slug} to insert the slug in the link for Nylas hosted scheduling pages. Additionally, you can use the placeholder {config.id} to insert the configuration ID anywhere in the link. For example: https://book.nylas.com/us/<YOUR_NYLAS_APP_CLIENT_ID>/{slug}. us denotes the region. Replace it with the appropriate region of your application. Replace <YOUR_NYLAS_APP_CLIENT_ID> with your Nylas app client ID. Note: Nylas hosted scheduling pages are only available for public configurations.string''

Events

EventDescriptionType
initThis event is fired when the provider is initialized. By default, this event handles determining if the user is logged in or not. In addition, it fetches the provided configuration if a valid configuration id is provided.CustomEvent<HTMLNylasSchedulerEditorElement>
loggedInThis event is fired when the the NylasAuth isAuthenticated state changes to true.CustomEvent<HTMLNylasSchedulerEditorElement>
loggedOutThis event is fired when the the NylasAuth isAuthenticated state changes to false.CustomEvent<HTMLNylasSchedulerEditorElement>
schedulerConfigCloseClickedThis event is fired when the close button on scheduler config is clicked.CustomEvent<HTMLNylasSchedulerEditorElement>

Methods

schedulerConnector() => Promise<NylasSchedulerConfigConnector | undefined>

This method is used to get the NylasSchedulerConfigConnector instance. You can use this instance to make requests to the Nylas API.

Returns

Type: Promise<NylasSchedulerConfigConnector | undefined>

Promise<NylasSchedulerConfigConnector | undefined>

store() => Promise<NylasSchedulerConfigStoreType | undefined>

This method is used to get the NylasSchedulerConfigStore instance. You can use this instance to update or get the state of the store.

Returns

Type: Promise<CreateNylasSchedulerConfigStoreReturnType | undefined>

Promise<NylasSchedulerConfigStoreType | undefined>

Slots

SlotDescription
"login-required"This slot is used to display a message when the user is not logged in.

Shadow Parts

PartDescription
"nse__close-button"
"nse__header"
"nse__title"

Graph


Built with StencilJS