This is a sample implementation of the Corbado web-js package integrated into a web application built with Astro.
Please see the full blog post to understand the detailed steps needed to integrate passkeys into Astro apps.
src/components/PasskeyList.astro
: Component for displaying the list of passkeys.src/pages/Login.astro
: Page component for the sign-up / login screen.src/pages/Profile.astro
: Page component for the user profile information shown after successful authentication.
- Follow the steps in Getting started to create and configure a project in the Corbado developer panel.
- Add your project's ID to an environment file as shown in the
.env.example
file. - Ensure you have Node.js and npm installed to run the application.
Create a .env
file in the root of your project and add your Corbado project ID:
PUBLIC_CORBADO_PROJECT_ID=your_corbado_project_id
-
Install Dependencies:
npm install
-
Run the Project Locally:
npm run dev
Your application will start at http://localhost:4321
. You can now see the authentication UI and test the passkey login functionality.