{"id":29182820,"url":"https://github.com/magiclabs/magic-unity","last_synced_at":"2025-07-01T20:33:08.330Z","repository":{"id":37941643,"uuid":"502142960","full_name":"magiclabs/magic-unity","owner":"magiclabs","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-26T20:57:32.000Z","size":2836,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-08-26T23:57:31.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","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":"LICENSE","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":"2022-06-10T18:27:02.000Z","updated_at":"2024-08-26T20:57:34.000Z","dependencies_parsed_at":"2024-04-18T22:35:47.495Z","dependency_job_id":"8d77597e-d588-43e8-8fb4-b717063dd53e","html_url":"https://github.com/magiclabs/magic-unity","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/magiclabs/magic-unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fmagic-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fmagic-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fmagic-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fmagic-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclabs","download_url":"https://codeload.github.com/magiclabs/magic-unity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fmagic-unity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263033222,"owners_count":23403117,"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:58.564Z","updated_at":"2025-07-01T20:33:08.244Z","avatar_url":"https://github.com/magiclabs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"**We have decided to temporarily archive this repository and place it into maintenance mode. This decision allows us to focus our efforts and resources on advancing our core product line. During this period, active development and the addition of new features will be paused. We value the contributions of the community and appreciate your understanding as we prioritize our main projects. We look forward to resuming development in the future and will keep you updated on any changes.**\n\n# Magic Unity SDK\n\nMagic empowers developers to protect their users via an innovative, passwordless authentication flow without the UX compromises that burden traditional OAuth implementations. \n\n[Documentation](https://magic.link/docs/login-methods/email/integration/unity)\n\n## ⚠️ Important Changes in Version 3.0.0 ⚠️\n\nStarting with version 3.0, the Magic Unity SDK has transitioned to using the Unity Package Manager for dependency management. This change offers a more convenient and robust method for managing dependencies.\n\nOld Implementation (Not Supported) ❌\n```csharp\nusing link.magic.unity.sdk\n```\n\nNew Implementation (Since Version 3.0)\n```csharp\nusing MagicSDK\n```\n\n## ⚠️ Removal of `LoginWithMagicLink()` ⚠️\nAs of `v2.0.0`, passcodes (ie. `LoginWithSMS()`, `LoginWithEmailOTP()`) are replacing Magic Links (ie. `LoginWithMagicLink()`) for all of our Mobile SDKs⁠. [Learn more](https://magic.link/docs/auth/login-methods/email/email-link-update-march-2023)\n\n\n## Platform Compatibility\nFor optimal performance, we recommend using this plugin with Unity 2021.3.3f1 or later.\n\n| Platform | Support? |\n|----------|----------|\n| iOS      | ✅        |\n| Android  | ✅        |\n| MacOS    | ✅        |\n| Editor   | ✅        |\n| Windows  | ✅        |\n| WebGL    | ❌        |\n\n\nNote: WebGL is not currently supported. For web-based projects, consider using [magic-js](https://github.com/magiclabs/magic-js) for passwordless authentication within a JavaScript environment.\n\n## Installation\n\nThere are a number of required packages that need to be added. We recommend just adding them directly to the to the `Packages/manfifest.json`. Your final `manifest.json` should resemble the following:\n\n```json\n{\n  \"dependencies\": {\n    \"link.magic.unity.sdk\": \"3.1.1\",\n    \"com.nethereum.unity\": \"4.19.2\",\n    \"net.gree.unity-webview\": \"https://github.com/gree/unity-webview.git?path=/dist/package\",\n    \"dev.voltstro.unitywebbrowser\": \"2.1.1\",\n    \"dev.voltstro.unitywebbrowser.communication.pipes\": \"1.0.1\",\n    \"dev.voltstro.unitywebbrowser.engine.cef\": \"2.1.0-121.3.13\",\n    \"dev.voltstro.unitywebbrowser.engine.cef.win.x64\": \"2.1.0-121.3.13\",\n    \"dev.voltstro.unitywebbrowser.unix-support\": \"1.0.1\"\n  },\n  \"scopedRegistries\": [\n    {\n      \"name\": \"Voltstro UPM\",\n      \"url\": \"https://upm-pkgs.voltstro.dev\",\n      \"scopes\": [\n        \"dev.voltstro\",\n        \"org.nuget\",\n        \"com.cysharp.unitask\"\n      ]\n    },\n    {\n      \"name\": \"OpenUPM\",\n      \"url\": \"https://package.openupm.com\",\n      \"scopes\": [\n        \"com.nethereum.unity\",\n        \"link.magic.unity.sdk\"\n      ]\n    }\n  ]\n}\n```\n\nYou will likely have many other references in your `dependencies` node and you may have other `scopedRegistries` as well, but these are the ones that are required to use the Magic Unity SDK.\n\n## Quick Start\n\nTry import Sample in Package Manager `prefabs/MagicExample.prefab` to get a quick start!\n\n### Instantiate Magic\n\nCreate a script with the following code and bind this to a Canvas or object that you love to start with\n\n```c#\npublic class MagicUnity : MonoBehaviour\n{\n    // Attach this script when you start the canvas \n    void Start()\n    {\n        Magic magic = new Magic(\"YOUR_PUBLISHABLE_KEY\");\n        \n        // Append the instance here, so that it can be shared across the project\n        Magic.Instance = magic;\n    }\n}\n```\n\nFor macOS editor support, you'll need to pass an additional parameter `macCanvas` to properly render Magic components. The object you pass in should be the name of your app's primary canvas.\n\n```c#\npublic class MagicUnity : MonoBehaviour\n{\n    // Attach this script when you start the canvas \n    void Start()\n    {\n        Magic magic = new Magic(\"YOUR_PUBLISHABLE_KEY\", macCanvas: GameObject.Find(\"Magic Example 1\"));\n        \n        // Append the instance here, so that it can be shared across the project\n        Magic.Instance = magic;\n    }\n}\n```\n\n### User Authentication\n\n```c#\nawait magic.Auth.LoginWithEmailOtp(\"hiro@magic.link\");\n```\n\n### Web3 interaction\n\nAfter the user has been authenticated, now it's a good time to get the users on the blockchain. \n\nMagic Unity builds on top of Nethereum to enable web3 functionalities. For more detail about Nethereum, please check their official docs https://docs.nethereum.com/en/latest/ \nand their github repo about [RPC payloads](https://github.com/Nethereum/Nethereum/tree/f0f7cbd225fadfce681faff004a57e480428e62b/src/Nethereum.RPC)\n\n```c#\n        // Get Eth Account  \n         var ethAccounts = new EthAccounts(Magic.Instance.Provider);\n        var accounts = await ethAccounts.SendRequestAsync();\n         \n         // Eth sign\n        var personalSign = new EthSign(Magic.Instance.Provider);\n        var transactionInput = new TransactionInput{Data = \"Hello world\"};\n        var res = await personalSign.SendRequestAsync(accounts[0], \"hello world\");\n    \n        // Send Transaction\n        var transaction = new EthSendTransaction(Magic.Instance.Provider);\n        var transactionInput = new TransactionInput\n            { To = accounts[0], Value = new HexBigInteger(10), From = accounts[0]};\n        var hash = await transaction.SendRequestAsync(transactionInput);\n```\n\n### Support\nMore blockchain support will be coming soon. Feel free to send your requests and issues to `support@magic.link` or via our helpdesk. Happy coding!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fmagic-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclabs%2Fmagic-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fmagic-unity/lists"}