This is a sample implementation of the Corbado webcomponent being integrated into a web application built with Next.js.
src/app/page.tsx
: the file where the web component is embeddedpages/profile.tsx
: displays user information if the user has successfully authenticateddelcarations.d.ts
: contains type declarations you need to add as well to make the web component work in TypeScript.env
: add relevant environment variables that you can obtain from Corbado developer panel
Please follow the steps in Getting started to create and configure a project in the Corbado developer panel.
You need to have Node and npm
installed to run it.
Use the values you obtained in Prerequisites to configure the following variables inside an .env
file you create in the root folder of this project:
NEXT_PUBLIC_PROJECT_ID=<YOUR PROJECT ID>
API_SECRET=<YOUR API SECRET>
Run
npm i
to install all dependencies.
Finally, you can run the project locally with
npm run dev