{"id":19204303,"url":"https://github.com/blazorextensions/webusb","last_synced_at":"2025-05-12T15:45:31.475Z","repository":{"id":33228914,"uuid":"154231492","full_name":"BlazorExtensions/WebUSB","owner":"BlazorExtensions","description":"HTML5 WebUSB APIs for Microsoft ASP.Net Core Blazor","archived":false,"fork":false,"pushed_at":"2023-03-23T15:38:20.000Z","size":350,"stargazers_count":78,"open_issues_count":18,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-19T23:20:08.120Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlazorExtensions.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":"2018-10-22T23:38:08.000Z","updated_at":"2025-04-18T09:09:09.000Z","dependencies_parsed_at":"2024-06-19T00:02:22.106Z","dependency_job_id":"1d87e042-5693-4354-9fe8-e3be45718811","html_url":"https://github.com/BlazorExtensions/WebUSB","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":"0.11111111111111116","last_synced_commit":"7e88cdb7fd0abfed78d1c0de727f493ee547cdb7"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlazorExtensions%2FWebUSB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlazorExtensions%2FWebUSB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlazorExtensions%2FWebUSB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlazorExtensions%2FWebUSB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlazorExtensions","download_url":"https://codeload.github.com/BlazorExtensions/WebUSB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253767619,"owners_count":21961144,"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":"2024-11-09T13:07:08.717Z","updated_at":"2025-05-12T15:45:31.449Z","avatar_url":"https://github.com/BlazorExtensions.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Canvas\r\nHTML5 WebUSB API implementation for Microsoft Blazor\r\n\r\n[![Build](https://github.com/BlazorExtensions/WebUSB/workflows/CI/badge.svg)](https://github.com/BlazorExtensions/WebUSB/actions)\r\n[![Package Version](https://img.shields.io/nuget/v/Blazor.Extensions.WebUSB.svg)](https://www.nuget.org/packages/Blazor.Extensions.WebUSB)\r\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Blazor.Extensions.WebUSB.svg)](https://www.nuget.org/packages/Blazor.Extensions.WebUSB)\r\n[![License](https://img.shields.io/github/license/BlazorExtensions/WebUSB.svg)](https://github.com/BlazorExtensions/WebUSB/blob/master/LICENSE)\r\n\r\n# Blazor Extensions\r\n\r\nBlazor Extensions are a set of packages with the goal of adding useful things to [Blazor](https://blazor.net).\r\n\r\n# Blazor Extensions WebUSB\r\n\r\nThis package wraps [HTML5 WebUSB](https://wicg.github.io/webusb/) APIs. \r\n\r\n# Installation\r\n\r\n```\r\nInstall-Package Blazor.Extensions.WebUSB\r\n```\r\n\r\n# Sample\r\n\r\n## Usage\r\n\r\n- First add the USB services on Blazor `IServiceCollection`:\r\n\r\n```c#\r\npublic void ConfigureServices(IServiceCollection services)\r\n{\r\n    services.UseWebUSB(); // Makes IUSB available to the DI container\r\n}\r\n```\r\n\r\n### To consume on your `.cshtml`:\r\n\r\n- On your `_ViewImports.cshtml` add the using entry:\r\n\r\n```c#\r\n@using Blazor.Extensions.WebUSB\r\n```\r\n\r\n- Then, on your `.cshtml` inject the `IUSB`:\r\n\r\n```c#\r\n@inject IUSB usb\r\n```\r\n\r\nAnd then use the `usb` object to interact with connected USB devices thru your Blazor application.\r\n\r\n### To inject on a `BlazorComponent` class:\r\n\r\nDefine a property of type `IUSB` and mark it as `[Injectable]`:\r\n\r\n```c#\r\n[Inject] private IUSB _usb { get; set; }\r\n```\r\n\r\nThen use the `_usb` variable to interact with the connected USB devices.\r\n\r\n**Note**: For now, you have to call `await IUSB.Initialize()` once in your application. This is a temporary requirement and we are looking on a better way to automatically register to _Connect/Disconnect_ events.\r\n\r\n# Contributions and feedback\r\n\r\nPlease feel free to use the component, open issues, fix bugs or provide feedback.\r\n\r\n# Contributors\r\n\r\nThe following people are the maintainers of the Blazor Extensions projects:\r\n\r\n- [Attila Hajdrik](https://github.com/attilah)\r\n- [Gutemberg Ribiero](https://github.com/galvesribeiro)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblazorextensions%2Fwebusb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblazorextensions%2Fwebusb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblazorextensions%2Fwebusb/lists"}