1. Prerequisites

First, you need to set up a Corbado project.

To get started with the integration, install the Corbado web-js package.

npm install @corbado/web-js

Further information on web-js can be found here

2. Define custom elements schema

To prevent build failures due to unrecognized elements, Angular mandates the declaration of custom elements within your Angular modules. To achieve this, you should import the CUSTOM_ELEMENTS_SCHEMA and include it in the schemas section of your module:

app.module.ts
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";

import { AppComponent } from "./app.component";
import { ProfileComponent } from "./profile/profile.component";
import { AppRoutingModule } from "./app-routing.module";
import { LoginComponent } from "./login/login.component";

@NgModule({
    declarations: [AppComponent, ProfileComponent, LoginComponent],
    imports: [BrowserModule, AppRoutingModule],
    providers: [],
    bootstrap: [AppComponent],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}

3. Add the web-js package to Angular Code

<div id="corbado-auth"></div>

4. Read the blog post

To find a step-by-step tutorial on how to integrate passkeys into Angular, please check out our blog post:

Corbado Logo