{"id":15287658,"url":"https://github.com/improv-wifi/sdk-serial-js","last_synced_at":"2025-04-13T06:03:56.249Z","repository":{"id":37960055,"uuid":"422481334","full_name":"improv-wifi/sdk-serial-js","owner":"improv-wifi","description":"JavaScript SDK to add Improv Wi-Fi over serial to your website.","archived":false,"fork":false,"pushed_at":"2023-05-08T15:57:53.000Z","size":498,"stargazers_count":13,"open_issues_count":9,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T04:35:45.215Z","etag":null,"topics":["esp32","esp8266","webserial","wifi-provisioning"],"latest_commit_sha":null,"homepage":"https://www.improv-wifi.com","language":"TypeScript","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/improv-wifi.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":"2021-10-29T07:29:16.000Z","updated_at":"2024-11-18T16:36:54.000Z","dependencies_parsed_at":"2024-06-19T01:31:30.517Z","dependency_job_id":"d8ed50c5-ab91-47d6-a160-2be1f7dbaa88","html_url":"https://github.com/improv-wifi/sdk-serial-js","commit_stats":{"total_commits":117,"total_committers":3,"mean_commits":39.0,"dds":"0.41025641025641024","last_synced_commit":"480cf2f40602d9b88109895f8b33674cdc628a5d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/improv-wifi%2Fsdk-serial-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/improv-wifi%2Fsdk-serial-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/improv-wifi%2Fsdk-serial-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/improv-wifi%2Fsdk-serial-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/improv-wifi","download_url":"https://codeload.github.com/improv-wifi/sdk-serial-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647225,"owners_count":21139084,"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":["esp32","esp8266","webserial","wifi-provisioning"],"created_at":"2024-09-30T15:33:48.178Z","updated_at":"2025-04-13T06:03:56.188Z","avatar_url":"https://github.com/improv-wifi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript SDK for Improv Wi-Fi over Serial\n\n## Installation\n\nIf you are using a bundler and JavaScript package manager, you can install the SDK via NPM:\n\n```\nnpm install --save improv-wifi-sdk\n```\n\nAnd then import it in your code:\n\n```\nimport 'improv-wifi-serial-sdk';\n```\n\n## Usage\n\nAdd the following to your website to show a button to start the provisioning process:\n\n```html\n\u003cimprov-wifi-serial-launch-button\u003e\u003c/improv-wifi-serial-launch-button\u003e\n```\n\nA warning message will be rendered if the browser does not support WebSerial.\n\nThe SDK will render an error when the connected device does not support Improv. If it is opt-in for your software, you can set a link as the `learnMoreUrl` attribute to include this link in the error message.\n\n```html\n\u003cimprov-wifi-serial-launch-button\n  learnMoreUrl=\"https://www.esphome.io/components/improv_serial.html\"\n\u003e\u003c/improv-wifi-serial-launch-button\u003e\n```\n\n### Attributes\n\nThe following attributes are automatically added to `\u003cimprov-wifi-serial-launch-button\u003e` and can be used for styling:\n\n| Attribute | Description |\n| -- | -- |\n| `supported` | Added if this browser is supported\n| `unsupported` | Added if this browser is not supported\n\n### Slots\n\nIt is possible to customize the button and the message. You do this by putting your elements inside the `\u003cimprov-wifi-serial-launch-button\u003e` element and adding the appropriate `slot` attribute. Use `activate` to replace the activation button and `unsupported` to replace the unsupported message:\n\n```html\n\u003cimprov-wifi-serial-launch-button\u003e\n  \u003cbutton slot='activate'\u003eStart provisioning!\u003c/button\u003e\n  \u003cspan slot='unsupported'\u003eYour browser does not support provisioning.\u003c/span\u003e\n\u003c/improv-wifi-serial-launch-button\u003e\n```\n\n### Events\n\nWhen the dialog is closed, a `closed` event will be fired on both `\u003cimprov-wifi-serial-launch-button\u003e` and `\u003cimprov-wifi-serial-provision-dialog\u003e`. This event will have a `detail` property with the following properties:\n\n - `improv`: Boolean indicating if we connected to a device running Improv.\n - `provisioned`: Boolean indicating if the device is connected to Wi-Fi.\n\n## Browser Support\n\nThis SDK requires a browser with support for WebSerial. Currently this is supported by Google Chrome, Microsoft Edge and other browsers based on the Blink engine.\n\nNo iOS devices are supported.\n\n## Standalone usage\n\nThe serial SDK can also be used standalone without the UI.\n\n```ts\nimport { ImprovSerial } from \"improv-wifi-serial-sdk/dist/serial.ts\";\n\nconst port = await navigator.serial.requestPort();\nawait port.open({ baudRate: 115200 });\nconst improv = new ImprovSerial(port, console);\n\nimprov.addEventListener(\"state-changed\", console.log);\nimprov.addEventListener(\"error-changed\", console.log);\n\nawait improv.initialize();\n\nimprov.addEventListener(\"disconnect\", console.log);\n\nconsole.log({\n  info: improv.info,\n  nextUrl: improv.nextUrl,\n});\n\nawait improv.provision(\n  \"My Wifi\",\n  \"My password\",\n  30000  // Optional: Timeout in ms\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimprov-wifi%2Fsdk-serial-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimprov-wifi%2Fsdk-serial-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimprov-wifi%2Fsdk-serial-js/lists"}