This is a sample implementation of frontend and backend where the Corbado Node.js SDK and Web-js components are integrated in an Express application.
├── ...
├── .env # Environment variables for the application
├── src
│ ├── app.ts # Application Entrypoint
│ ├── routes.ts # Defines our routes
│ ├── authController.ts # Handles all of our endpoints
│ └── userService.ts # Service to manage User data
└── ...
Please follow our Getting started page to create and configure a project in the developer panel.
Use the values you obtained above to configure the following variables inside .env
:
- CORBADO_PROJECT_ID: The project ID.
- CORBADO_API_SECRET: The API secret.
- CORBADO_FRONTEND_API: The frontend API URL.
- CORBADO_BACKEND_API: The backend API URL.
Use the following command to install all dependencies:
npm i
Now, you're ready to run the app like this:
npm run start
After step 2 your local server should be fully working.
If you now visit http://localhost:3000
, you should be seeing our authentication UI.
Create an account and take a look at the profile page under /profile
you'll be forwarded to.