Links

Svelte

Learn how to add the Corbado web component to your Svelte application.

1. Prerequisites

To get started with the integration in Svelte, install the dependencies and get all required setup data, please follow the guide of web component integration first.

2. Add the web component to Svelte code

Corbado.svelte
1
<script>
2
import {PUBLIC_CORBADO_PROJECT_ID} from '$env/static/public';
3
import '@corbado/webcomponent'
4
import '@corbado/webcomponent/pkg/auth_cui.css';
5
</script>
6
7
<corbado-auth
8
project-id={PROJECT_ID}
9
conditional="yes"
10
>
11
<input
12
name="username"
13
id="corbado-username"
14
required
15
autocomplete="webauthn"
16
/>
17
</corbado-auth>

3. Read the blog post

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