{"id":21590263,"url":"https://github.com/corbado/passkeys-supabase","last_synced_at":"2025-04-10T21:56:37.849Z","repository":{"id":181152131,"uuid":"646775666","full_name":"corbado/passkeys-supabase","owner":"corbado","description":"Example integration of Corbado's passkey-first web component with Supabase as backend provider","archived":false,"fork":false,"pushed_at":"2024-01-24T18:31:09.000Z","size":163,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T21:56:26.672Z","etag":null,"topics":["authentication","faceid","fido2","javascript","passkey","passkeys","supabase","touchid","webauthn","webcomponents"],"latest_commit_sha":null,"homepage":"https://www.corbado.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corbado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-05-29T10:09:24.000Z","updated_at":"2025-04-09T10:25:23.000Z","dependencies_parsed_at":"2024-01-24T19:41:22.559Z","dependency_job_id":"b5f22440-66a2-480c-b150-e03ad94513f7","html_url":"https://github.com/corbado/passkeys-supabase","commit_stats":null,"previous_names":["corbado/passkeys-supabase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fpasskeys-supabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fpasskeys-supabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fpasskeys-supabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fpasskeys-supabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbado","download_url":"https://codeload.github.com/corbado/passkeys-supabase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305838,"owners_count":21081574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","faceid","fido2","javascript","passkey","passkeys","supabase","touchid","webauthn","webcomponents"],"created_at":"2024-11-24T16:17:25.853Z","updated_at":"2025-04-10T21:56:37.825Z","avatar_url":"https://github.com/corbado.png","language":"JavaScript","readme":"# Complete integration sample for the Corbado web component in Node.js with existing users in Supabase\n\nThis is a sample implementation of frontend and backend where the Corbado web component is integrated. The database provider is Supabase, an open-source Firebase alternative which already contains several password-based users. These\nusers are integrated using Corbado webhooks while new users are saved without a password.\n\n**Note:** In this tutorial a customer system is created with some pre-existing password-based users. Have a look at our [docs](https://docs.corbado.com/integrations/web-component/no-existing-user-base) to see the integration if you don't have any users yet.\n\n## 1. File structure\n\n```\n├── app.js\n├── .env\n├── src\n|   ├── controllers\n|   |   ├── authController.js           # renders views and uses Corbado SDK for sessions\n|   |   └── corbadoWebhookController.js # Takes all requests belonging to the Corbado webhook logic\n|   ├── routes\n|   |   ├── authRoutes.js               # All routes belonging to certain views\n|   |   └── corbadoWebhookRoutes.js     # All routes belonging to the Corbado webhook\n|   ├── services\n|   |   └── userService.js              # Communicates with Supabase\n|   ├── views/pages\n|   |   ├── login.ejs                   # Login page with the webcomponent\n|   |   └── profile.ejs                 # Profile page showing user info\n```\n\n## 2. Setup\n\n### 2.1. Configure Corbado project\n\nPlease follow the steps on our [Getting started](https://docs.corbado.com/overview/getting-started) page to create and configure a project in the [Corbado developer panel](https://app.corbado.com). Use `http://localhost:19915` as origin.\n\nNext, follow steps 4-6 on our [Web component guide](https://docs.corbado.com/integrations/web-component) and set the Application URL to `http://localhost:19915/login`, the Redirect URL to `http://localhost:19915/profile` and the Relying Party ID to `localhost`.\n\nLastly, configure the [webhooks](https://app.corbado.com/app/settings/webhooks) as seen in the image:\n\u003cimg width=\"1238\" alt=\"webhooks\" src=\"https://github.com/corbado/passkeys-supabase/assets/23581140/2d158756-ddd3-4c21-b266-f88596a8add2\"\u003e\n\n\n\n### 2.2. Create Supabase project\n\nHead over to [Supabase](https://supabase.com) to create a project using the Supabase web interface.\n\nNext, go to the SQL Editor and execute the following query:\n\n```SQL\nCREATE OR REPLACE FUNCTION get_user_id_by_email(email TEXT)\nRETURNS TABLE (id uuid)\nSECURITY definer\nAS $$\nBEGIN\n  RETURN QUERY SELECT au.id FROM auth.users au WHERE au.email = $1;\nEND;\n$$ LANGUAGE plpgsql;\n```\nIf everything has worked fine, you should see the following success message\n\n`Success. No rows returned`\n\nFeel free to create some password-based users in the ```Authentication \u003e Users``` page. Then, click on the button \"Add user\" in the top right. Remember to set autoconfirm to true!\n\n### 2.3. Configure environment variables\n\nWe now need to configure the following variables inside `.env`:\n\nProject ID as well as API secret shall be used from step 2.1.\nThe CLI secret is located [here](https://app.corbado.com/app/settings/credentials/cli-secret).\nYour Supabase credentials can be found at ```Project Settings \u003e API``` inside the Supabase dashboard.\n\n```\nPROJECT_ID=\nAPI_SECRET=\nCLI_SECRET=\n\nWEBHOOK_USERNAME=\"webhookUsername\"\nWEBHOOK_PASSWORD=\"webhookPassword\"\n\nSUPABASE_URL=\nSUPABASE_API_KEY_SERVICE_ROLE=\nSUPABASE_JWT_SECRET=\n```\n\n### 2.4. Start Docker containers\n\n**Note:** Before continuing, please ensure you have [Docker](https://www.docker.com/products/docker-desktop/) installed and accessible from your shell.\n\nUse the following command to start the system:\n\n```\ndocker compose up\n```\n\n**Note:** Please wait until all containers are ready. This can take some time.\n\n## 3. Usage\n\nAfter step 2.4. your local server should be fully working.\n\nIf you now visit `http://localhost:19915`, you should be forwarded to the `/login` page.\n\nWhen authenticated you will be forwarded to the `/profile` page.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fpasskeys-supabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbado%2Fpasskeys-supabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fpasskeys-supabase/lists"}