web-components-new-apisAuthentication

Web Components are the New APIs

Web components are becoming more popular than APIs. We explain for developers what the reasons for this trend are and how you can benefit.

Blog-Post-Author

Janina

Created: January 13, 2023

Updated: June 3, 2024


For a long time, it was rather quiet around web components. Currently, however, they are rising in popularity even faster than APIs. The new login standard on the web, passkeys, is one technology that greatly benefits from web components, since the advantages of passkeys can be easily exploited with web components. We will explain why in the next post.

APIs have been around for quite some time and are getting constantly more attention in recent years. Programs today must be highly available, as error- free as possible and easy to maintain. For this reason, modularization the main goal of APIs is becoming increasingly popular. Investors also are eager to invest in models that leverage APIs, and many traditional SaaS providers now use API-first models. However, web components have also been around for a while now. For a long time, it was rather quiet around them and many already thought that they failed. However, recently they have become even more popular than APIs we will explain why in the following article.

What are the main differences between web components and APIs?

APIs (application programming interfaces) provide a way for applications to interact with one another in a structured way. They allow developers to access data from a third-party application or service and can be used to integrate existing services with a web application. APIs provide a powerful way to increase the functionality of an application and make it easier to build complex and transformative user experiences. One of the most commons APIs are REST APIs and GraphQL. APIs are not self-contained, which differentiates them from web components. These components are a collection of web technologies that allow developers to create reusable, self-contained components for web applications. They are composed of HTML, CSS, JavaScript, and other web technologies, and are meant to be used as building blocks for web applications. Unlike APIs, web components are self-contained and can be used to create highly interactive user experiences. They are designed to be easy to use and can be used across multiple frameworks and libraries. They provide a way to create encapsulated and reusable components that can be used in multiple web applications. They are compatible with (or without) any JavaScript library or framework (e.g., React, Angular, Vue.js, Next.js), and work with all modern browsers.

Web components are a higher-level of abstraction than APIs. The components themselves use an API, which is also where their strength lies. It brings the power to create reusable components with nothing more than HTML, CSS, and vanilla JavaScript. They provide UIs to end-users instead of just a function to developers, so they inherently offer more value.

The rise of web components

Web Components are getting more popular every day: Today, more than 10% of all page loads in Google Chrome are pages that contain web components! Big tech companies like Apple, Google, and Facebook are also investigating ways of using web components in their applications and JavaScript Frameworks (e.g., Angular and React).

Currently,offer full support for web components. The exceptions are Internet Explorer 11 which in turn is no longer supported by Microsoft and Safari, as the browsers only partially support the web component standards. Ever since, the use of web components became even more attractive, as now not only the integration is easier, but also most browsers support these applications.

Why web components are the new APIs

Modern web development becomes more complex every day, and, now that the web platform and its standards are maturing, it makes more sense to use web components more intensively. They are becoming increasingly important in modern web development as they offer powerful tools for creating custom, reusable code components without the need for complex frameworks, saving them time and effort.

Web components are highly modular and can be reused across a variety of projects. Built with HTML, CSS and JavaScript, they are lightweight and can be easily customized to meet the needs of any project. By providing better encapsulation of code, web components not only make it easier to organize and maintain code, but also protect it from changes made by others. As a result, they can be used to create secure and isolated components. Web components also allow developers to create more dynamic, interactive websites and to take advantage of the latest web technologies and web standards, as they can be updated and maintained in real time. This gives them a leg up on the competition.

With all these benefits, web components are becoming an essential part of modern web development. Its ever-increasing popularity proves that they are here to stay and the integration of a passkey login with web components is more attractive than one with APIs.

How to boost the benefits of passkeys with web components

One technology that benefits tremendously from web components are passkeys, the new login standard on the web, because the advantages of passkeys can quickly be leveraged with web components:

Blog Post Image

  1. Increased security in authentication: To achieve a high level of security, passkeys use public-key cryptography, making them highly resistant to phishing and theft. As passkeys eliminate passwords as a point of failure, only the code remains as a possible point of attack for hackers. Web components are designed to be self-contained, which means that the code is isolated from other resources and makes it difficult for attackers to exploit. The integration of a passkey login with web components thus provides numerous layers of security that make authentication extremely robust against attacks.

  2. Reduced development time and costs for integration into existing systems: Developers can use web components to create custom login pages quickly, reducing the need for custom coding or API integration. If companies do not yet have a passkey login on their website, developers can easily integrate one into existing systems using web components. Especially if companies would like to test passkeys first and do not yet want to invest large development resources, an integration with web component is an attractive option: developers neither have to change anything in their existing systems nor write new code. Thus, the development time can be reduced enormously.

  3. Improved performance to allow quick authentication: Passkeys are a password replacement that provides faster and easier login to websites and apps across users devices, as they do not have to remember and type in a password anymore. To make logging in to a website or app an even faster and smoother process, page load times can also be accelerated: web components are designed to be reusable and can be easily shared across different websites, resulting in faster page load times.

  4. Improved user experience: On one side, passkeys allow users to access a system without creating another password, reducing the login effort and improving the user experience. Making use of biometric data for authentication, passkeys are the most user friendly passwordless authentication solution today. On the other side, web components can be easily customized to meet specific user requirements and preferences, providing an even more tailored user experience. A very effortless and fast login using passkeys accompanied by further customized options through web components ensures the optimal customer experience when logging in to a website or app.

Corbado offers passkeys-as-a-service

Because of these advantages, Corbado offers a web component for the integration of passkeys. Developers can easily embed it into their existing systems with just a few lines of code:

< html> <head> <script defer src="https://<CNAME>/auth.js"></script> </head> <body> <!-- Your website content --> <corbado-auth endpoint="https://<CNAME>" conditional="yes"> <input name="username" id="corbado-username" value="" required autocomplete="webauthn" autofocus/> </corbado-auth> <!-- Your website content --> </body> </html>

Authentication is no longer just a security issue. Especially with passkeys the user experience is becoming more and more important. Therefore, Corbado is focusing on user experience and product intelligence, which can be most easily provided by web components:

Passkeys are not a pure backend technology that can be easily covered with an API rather, the frontend or user experience always plays a major role in the integration of passkeys. It is extremely important what the users experience, independently of the device, browser and operating system they use Since it is very complex to query all this via API, Corbado makes it as easy as possible and "hides" these queries in a web component.

The complete login process is covered in the web component, including password(less) fallback, as well as risk-based authentication, SSO and social logins. This means that the implementation effort remains minimal despite covering the complex process.

Internally, the web component uses Corbados own API, which each customer can of course also use independently ( however, the integration would take more time with APIs). Unlike other authentication providers, Corbado's solution allows the customer to use the web component and API in parallel and synchronize everything with the customer's existing backend systems bi- directionally.

Corbado's goal is to keep the promise that anyone can quickly and easily upgrade to passkeys and does not have to worry about the countless cross- device and cross-platform issues that passkeys involve. That is why Corbado has pre-built web components to offer passkeys-as-a-service today.

Share this article


LinkedInTwitterFacebook

Table of Contents

Enjoyed this read?

🤝 Join our Passkeys Community

Share passkeys implementation tips and get support to free the world from passwords.

🚀 Subscribe to Substack

Get the latest news, strategies, and insights about passkeys sent straight to your inbox.


We provide UI components, SDKs and guides to help you add passkeys to your app in <1 hour

Start for free