Skip to content

Scheduler Quickstart guide: set up Scheduler

In this guide, you’ll build a sample web application that allows you to host the Scheduler Editor and Scheduling Pages. Using the application, you’ll create your first Scheduling Page.

If you want to see the complete code for this Quickstart guide, you can find it on GitHub: Web component (HTML) or React.

A sample web app that demonstrates a Scheduling Page and the Scheduler Editor

Before you begin

For this Quickstart guide, we’ll use the Node environment to create our frontend application, and run it locally. If you prefer to work with a different coding language, you can use any environment or framework that lets you run the front end application locally.

Be sure to have the following ready before you begin:

  • The Node development environment installed- The minimum required Node version is v18.0.0. To check the Node version, run node -v in your terminal.

Set up your Nylas account

This section is all about what we need to do before we start coding.

  • Create a Nylas account - Nylas offers a free Sandbox account where you can prototype and test the Nylas APIs. Sign up to create a Nylas account.
  • Get your application credentials - To use the Nylas API, you need your Nylas application’s client ID, which you can get from the Dashboard. You’ll save these credentials in your code environment as NYLAS_CLIENT_ID. You can find your Nylas client ID on the Dashboard Overview page:

Bootstrap your app

This section walks you through setting up a basic local project to serve a front-end application. Nothing here is Nylas-specific - we’re just getting the server scaffold ready.

Create a new local project

First, create a new local project for testing in a new directory called /nylas-scheduler. There are two ways to add a custom Scheduler: using Web components (HTML) or React. Pick one of these paths as you complete the rest of the Quickstart guide. Start by copying and pasting the commands below directly into your terminal or command line tool.

Set up user auth using Nylas

This explains how to configure Nylas’ Hosted authentication to authenticate users in your app.

Register callback URI

Next, register a callback URI with Nylas. This is where Nylas redirects the user when they complete authentication.

For this walkthrough, the URI includes localhost because we’re using a local development environment. The default port is 3000.

  1. In your Sandbox application, click Hosted Authentication in the left navigation, and click Callback URIs.
  2. Click Add a callback URI, and enter your application’s callback URI.
  3. Select the JavaScript platform.
  4. For URL, enter http://localhost:<PORT>/scheduler-editor.
  5. For Origin, enter http://localhost:<PORT>.
  6. Click Add callback URI.
Hosted authentication screen showing the Callback URIs tab, and a freshly added entry for a localhost callback URI.

The URL endpoints can be anything you want. However, they must match the callback URI and port in your application when you configure the Scheduler Editor Component.

Set up the Scheduler Editor and Scheduling Components

This section is the fun part! Now that you’ve set up user authentication, you can use the Nylas Scheduler Editor to create a Scheduling Page.

There are lots of options and data properties to play around with. You’ll see a few in the following examples, and you can visit the Scheduler UI Components reference documentation to learn more.

In this section, you’ll learn how to…

Include the Nylas Scheduler Editor and Scheduling scripts in your app

To use the Scheduler UI Components, you need to include the Scheduler Editor and Scheduling scripts in your app. The files that you need to update vary depending on whether you’re building with HTML/Vanilla JS or React.

TypeUI ComponentFiles
HTML/Vanilla JSScheduler Editorscheduler-editor.html
Schedulingindex.html
ReactScheduler EditorApp.tsx, index.css
SchedulingApp.tsx, App.css

The following examples add the Nylas Scheduler Editor and Scheduling scripts in your app.

Start a local development server

To create a Scheduling Page from the Scheduler Editor, you’ll need a working Scheduler UI. To do this, run a local server to host your Scheduler Editor and Scheduling Pages.

Navigate the root directory of your project and run the following command.

After you run the command, open your browser to http://localhost:<PORT>/scheduler-editor to see your Scheduler Editor.

Create a Scheduling Page

When you visit the Scheduler Editor, you are prompted to log in to the editor using the provider of your choice. Select the provider to use and log in to your account. After you log in, the provider redirects you to the Scheduler Editor.

A screenshot of the Scheduler Editor login page

You can now create a new Scheduling Page. Click Create new.

A screenshot of the Scheduler Editor listing Scheduling Pages

Enter the event title, duration, and description. To set the availability for the event, click Availability in the left navigation. After you enter the event details, click Create.

A screenshot of the Scheduler Editor creating the Scheduling Page

If you click Cancel, the Scheduler Editor shows the manager view, which includes a list of available Scheduling Pages.

A screenshot of the Scheduler Editor Preview

Visit your Scheduling Page

To visit the Scheduling Page you just created, click Preview from the Scheduler Editor manager view. The Scheduling Page’s URL includes the configuration ID. Once you have the configuration ID, you can also visit the Scheduling Page at http://localhost:3000/?config_id=<NYLAS_SCHEDULER_CONFIGURATION_ID>.

The Scheduling Page allows you to book an event using the configuration you set the previous steps.

A screen showing the Nylas scheduling component