Before we can begin to render the Corbado Authentication UI, the Corbado.load() call has to resolve. Find more here.

Integration

The Authentication UI allows the user to log in or register with Corbado. The UI is rendered by using the Corbado.mountAuthUI method. Once the user is logged in, the onLoggedIn callback is executed.

main.html
<!DOCTYPE html>
<html>
<head>
    <link
        rel="stylesheet"
        href="https://unpkg.com/@corbado/web-js@2/dist/bundle/index.css"
    />
    <script src="https://unpkg.com/@corbado/web-js@2/dist/bundle/index.js"></script>
<body>
    <script type="module">
        await Corbado.load({
            projectId: "pro-XXX"
        });
        const authElement = document.getElementById("corbadoAuth");
        Corbado.mountAuthUI(authElement, {
            onLoggedIn: () => {
                console.log("User logged in");
                // perform any action after the user logs in (e.g. redirect to another page)
            }
        });
    </script>
    <div id="corbadoAuth"></div>
</body>
</html>

Customize Styling and Translations

Corbado UI Components can be customized to match your application’s design and language preferences. You can adjust the styling and translations of the components to create a seamless user experience:

Next

Let your users manage their passkeys with the PasskeyList.