{"id":29182808,"url":"https://github.com/magiclabs/example-custom-email-otp","last_synced_at":"2025-07-01T20:33:04.334Z","repository":{"id":168715944,"uuid":"623194923","full_name":"magiclabs/example-custom-email-otp","owner":"magiclabs","description":"A white label login flow using Email OTP .","archived":false,"fork":false,"pushed_at":"2024-08-26T19:09:39.000Z","size":1264,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-26T22:23:00.854Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magiclabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-03T22:17:17.000Z","updated_at":"2024-08-26T19:09:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f3d0e13-5066-40d9-8ee0-f0dcb1ed17f8","html_url":"https://github.com/magiclabs/example-custom-email-otp","commit_stats":null,"previous_names":["magiclabs/example-custom-email-otp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/magiclabs/example-custom-email-otp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-custom-email-otp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-custom-email-otp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-custom-email-otp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-custom-email-otp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclabs","download_url":"https://codeload.github.com/magiclabs/example-custom-email-otp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-custom-email-otp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263033183,"owners_count":23403112,"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":[],"created_at":"2025-07-01T20:32:56.708Z","updated_at":"2025-07-01T20:33:04.310Z","avatar_url":"https://github.com/magiclabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom UI Email Login with Magic Dedicated Wallet and One-Time Password (OTP)\n\nMagic is a passwordless authentication sdk that supports passwordless email login via one-time passwords (OTP). This app will walk through implementing logins via email with OTP using your own UI.\n\n\u003e 🌐 **Live Demo → https://b2gzt5.csb.app/**\n\n# Quick Start Instructions\n\n```\n$ git clone git@github.com:magiclabs/example-custom-email-otp.git\n$ cd example-custom-email-otp\n$ yarn install\n$ yarn start\n```\n\n\u003e app starts on http://localhost:3000\n\n## Environment Variables\n\nReplace the API keys in `.env` with your own:\n\n```\nREACT_APP_MAGIC_PUBLISHABLE_KEY=pk_live_123...\n```\n\n## Event Handling\n\nThere are two flows demonstrated in this app for which events must be handled to successfully authenticate a user. The main flow is the login flow, the other is the device verification flow.\n\n## Events\n\n**Email OTP**\n\n| Event Name          | Definition                                                                      |\n| ------------------- | ------------------------------------------------------------------------------- |\n| `email-otp-sent`    | Dispatched when the OTP email has been successfully sent from the Magic server. |\n| `verify-email-otp`  | Emit along with the OTP to verify the code from user.                           |\n| `invalid-email-otp` | Dispatched when the OTP sent fails verification.                                |\n| `cancel`            | Emit to cancel the login request.                                               |\n\n**Device Verification**\n\n| Event Name                         | Definition                                                             |\n| ---------------------------------- | ---------------------------------------------------------------------- |\n| `device-needs-approval`            | Dispatched when the device is unrecognized and requires user approval. |\n| `device-verification-email-sent`   | Dispatched when the device verification email is sent.                 |\n| `device-approved`                  | Dispatched when the user has approved the unrecongized device.         |\n| `device-verification-link-expired` | Dispatched when the email verification email has expired.              |\n| `device-retry`                     | Emit to restart the device registration flow.                          |\n\n**Multi-Factor Auth**\n| Event Name | Definition |\n| -----------------------------| ---------------------------------------------------------------------- |\n| `mfa-sent-handle` | Dispatched when the MFA OTP is ready to be received. |\n| `verify-mfa-code` | Emit along with the MFA OTP to verify the code from user. |\n| `invalid-mfa-otp` | Dispatched when the MFA OTP sent fails verification. |\n| `recovery-code-sent-handle` | Dispatched when the MFA recovery code is ready to be received. |\n| `invalid-recovery-code` | Dispatched when the incorrect MFA recovery code is submitted. |\n| `recovery-code-success` | Dispatched when the MFA MFA recovery code is successfully submitted. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fexample-custom-email-otp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclabs%2Fexample-custom-email-otp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fexample-custom-email-otp/lists"}