- Products
- Solutions Use casesBy industry
- Developers
- Resources Connect
- Pricing
Everybody knows about APIs. They abstract complex functionality into a well-defined interface, providing essential backend infrastructure and powerful application functionality.
However, at Nylas, we found one big challenge: when our customers build software, providing them with an API is only one part of the solution. Our customers build our APIs into their software, which also involves UI work.
Frontend development expands the scope of integration work, requiring more design and development resources, which can become a significant blocker to implementing the features folks really want. Roadmap time is scarce, and the difference between a sprint for a single engineer and a couple of sprints involving product designers and front-end developers is a big one.
At Nylas, a question emerged: How could we make it quicker and easier for our customers to profit from the value our APIs brought? This question inspired the first version of Nylas Scheduler, which launched in 2019. It was our first prepackaged, full-stack workflow that allowed you to create scheduling UIs quickly, powered by our flagship APIs out-of-the-box.
Building Scheduler broke new ground. There are many best practices for building easy-to-use APIs, but there aren’t many examples of successful frontend+backend solutions. However, we did get some things right. For example, we saw significant product adoption and growth improvements by streamlining the front-end build. While the first version had some flaws, its ease of use made it one of our fastest-growing products.
After thousands of integrations, exposed to millions of end-users, here were some of the themes that began emerging from Scheduler v1:
Initially built as a POC app on Nylas API v2, the original Nylas Scheduler evolved incrementally, much like a customer-built app, leading to significant architectural limitations. While the first version was easy to use, it lacked the flexibility for users to extend and customize the product to fit their specific needs. Developers don’t want to feel constrained, and abstraction shouldn’t come at the cost of hitting a wall when the out-of-the-box solution isn’t quite right.
Earlier this year, we introduced Nylas API v3. While rolling out API v3, we decided the time was ripe to reimagine the next generation of the Nylas Scheduler. Leveraging the improvements from API v3, we were able to rearchitect it from the ground up to address the major learnings from the first version.
iFrames are notorious for causing integration and styling problems due to their isolation from the parent page. They slow down load times, complicate communication between the parent and the child, and can create security vulnerabilities.
To address these issues, we moved from the old iFrame-based model to Web Components, which we built using Stencil.js. This made the Scheduler more modular, customizable, and independent of any specific frontend framework.
Web Components provide a standardized way to create reusable and encapsulated HTML elements that can be fully controlled with the browser’s native API.
Key benefits:
For more information on Web Components and their history, check out this resource: MDN Web Components.
Stencil.js makes building Web Components easier and more efficient by giving developers a familiar, framework-like experience. It allows you to create reusable, native-feeling components using TypeScript and JSX while still outputting pure Web Components. Stencil also has built-in optimizations and automatic documentation generation, making it a great choice for building modern, customizable elements with minimal effort.
Our goal when designing the new Nylas Scheduler v3 was to provide a simple, out-of-the-box workflow that is easy to integrate into any web application while being flexible enough to work with the most complicated customer workflows. Each stage of the scheduling workflow provided by our components is fully customizable with code, ensuring that our customers can implement their specific business logic without adding unnecessary complexity to their own applications.
The default workflow follows a straightforward “happy path” where a user selects a date, picks a timeslot, confirms the booking, and receives a confirmation email. This flow is designed to be simple and effective for most use cases.
Let’s take a look at the default scheduling flow:
Developers can override key events to customize the workflow. For example, they may want to check if a user is logged in before confirming their booking:
The above diagram demonstrates a custom scheduling flow where we introduce an additional step to confirm the user is logged in before booking a time-slot. This is done by overriding the default workflow (i.e. when the user confirms the time slot).
Timeslot confirmation override:
const [storedtimeslot, setTimeslot] = useState({})
<NylasScheduling
eventOverrides={{
timeslotConfirmed: async (event, connector) => {
const timeslot = event.detail;
if (!userLoggedIn) {
// Interrupt default flow
event.preventDefault();
// Store timeslot
setTimeslot(timeslot);
redirectUserToLogin();
}
}
}}
/>
<NylasScheduling
defaultSchedulerState={{
selectedDate: new Date(storedTimeslot.start_time),
selectedTimeslot: storedTimeslot,
showBookingForm: true
}}
/>
Event overrides are an essential feature of the Nylas Scheduling components that allow customers to alter the behavior of key events in the default scheduling workflow. Our components expose all meaningful workflow events as JS events that can have their behavior overwritten by developers. This flexibility ensures that customers can customize as much or as little of the scheduling workflow to fit their specific use case.
Examples include:
Overrides in the Nylas Scheduler are simple to implement using JavaScript. Here are three key points for developers to consider:
By using event overrides, developers can build highly customized scheduling workflows that integrate seamlessly into their existing systems without rewriting the core logic of the scheduler.
For more information on custom event handlers, check out our documentation.
When offering customizability in terms of styling with HTML and CSS, it’s crucial to strike the right balance between flexibility and simplicity for implementers. Based on our experience with Scheduling components, here are some key takeaways to ensure that implementers don’t inadvertently cause issues with their customization:
Simple customization: Make it easy for customers to quickly update colors, fonts, and spacing without needing to delve into complex CSS or internal component structures. The themeConfig prop is an excellent example of this. It allows users to apply a few simple variables for fast changes, like primary colors or error styles.
Example:
<NylasScheduling
themeConfig={{
"--nylas-primary": "#2563eb",
"--nylas-error": "#cc4841"
}}
/>
Advanced customization: For users who need more granular control, provide mechanisms like CSS Shadow Parts. This allows them to fine-tune specific parts of the component without having to override everything. It keeps the component structure safe while allowing deep customizations when necessary.
Example:
nylas-scheduling::part(ndp__date--selected) {
color: green;
}
Providing comprehensive documentation and examples is essential to help implementers fully understand how to customize components effectively and follow best practices.
Ensure that the Scheduler comes with well-designed, sensible default styles that look polished and professional right out of the box. This reduces the need for users to extensively customize every element. Most styling needs should be addressed by simply adjusting the themeConfig, allowing users to make minor tweaks without diving into advanced customization. Defaults should be robust enough to stand independently, with deeper customization as an optional enhancement, not a requirement. This approach simplifies the implementation process and ensures that the component works well for a wide range of users with minimal effort.
To ensure our Scheduler is both reliable and adaptable, we’ve focused on several key areas that make it easier to maintain and scale:
At Nylas, we believe that the power of computing should be accessible to everyone. That’s why we focus on creating building blocks that are easy to use and flexible enough to adapt to your unique needs. With the newly imagined Scheduler, we’ve taken significant steps to ensure our tools empower you without getting in your way when your use case goes beyond the ordinary.
Ready to explore what the Scheduler can do for you? Dive into our product documentation and getting started guide to learn more and start building for free today.