{"id":27194783,"url":"https://github.com/peapodtechnologies/firebasedeviceflow","last_synced_at":"2025-04-09T19:36:28.887Z","repository":{"id":54647797,"uuid":"307919199","full_name":"PeaPodTechnologies/FirebaseDeviceFlow","owner":"PeaPodTechnologies","description":"Firebase authentication via OAuth2 Device Flow for Node.js CLI applications on limited input devices.","archived":false,"fork":false,"pushed_at":"2021-11-09T06:53:56.000Z","size":354,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-28T05:43:25.695Z","etag":null,"topics":["cli","device-flow","firebase","firebase-auth","iot","oauth2","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@peapodtech/firebasedeviceflow","language":"TypeScript","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/PeaPodTechnologies.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}},"created_at":"2020-10-28T05:50:01.000Z","updated_at":"2022-10-17T20:20:33.000Z","dependencies_parsed_at":"2022-08-13T22:40:48.167Z","dependency_job_id":null,"html_url":"https://github.com/PeaPodTechnologies/FirebaseDeviceFlow","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeaPodTechnologies%2FFirebaseDeviceFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeaPodTechnologies%2FFirebaseDeviceFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeaPodTechnologies%2FFirebaseDeviceFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeaPodTechnologies%2FFirebaseDeviceFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeaPodTechnologies","download_url":"https://codeload.github.com/PeaPodTechnologies/FirebaseDeviceFlow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248098508,"owners_count":21047455,"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":["cli","device-flow","firebase","firebase-auth","iot","oauth2","typescript"],"created_at":"2025-04-09T19:36:27.950Z","updated_at":"2025-04-09T19:36:28.880Z","avatar_url":"https://github.com/PeaPodTechnologies.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase Device Flow\n\n[![forthebadge](https://forthebadge.com/images/badges/open-source.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/powered-by-coffee.svg)](https://forthebadge.com)\n\nFirebase authentication via [OAuth2 'Device Flow'](https://www.oauth.com/oauth2-servers/device-flow/) for Node.js CLI applications on limited input devices (i.e. IoT).\n\n[![Build Status](https://travis-ci.com/UTAgritech/FirebaseDeviceFlow.svg?branch=master)](https://travis-ci.com/UTAgritech/FirebaseDeviceFlow)\n\n## Provider Setup\n\n### Google\n\n[Docs](https://developers.google.com/identity/protocols/oauth2/limited-input-device)\n\n1. Create new **OAuth client ID** credentials in the [GCP Credentials page](https://console.cloud.google.com/apis/credentials). For the Application Type, select \"TVs and Limited Input devices\".\n2. Copy the Client ID and Client Secret values into either an `.env` file, or input directly into the config object (see `test.ts`).\n\n### GitHub\n\n[Docs](https://docs.github.com/en/free-pro-team@latest/developers/apps/authorizing-oauth-apps#device-flow)\n\n1. Create a new GitHub OAuth app [(guide)](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app).\n2. Copy the Client ID and Client Secret values into either an `.env` file, or input directly into the config object (see `test.ts`).\n3. Set the Client ID and Client Secret fields in the Firebase Console under *Authentication* \u003e *Sign-in method* \u003e *Sign-in providers* \u003e *GitHub*\n4. Finally, copy the *Authorization callback URL* from the Firebase Console to your GitHub OAuth app's settings.\n\n## Example Usage\n\nSee [test.ts](./test.ts).\n\n3. Import `FirebaseDeviceFlow`.\n4. Initialize your Firebase app.\n5. Pass Firebase app reference and OAuth config object to `DeviceFlowUI` constructor. If any parameters are absent from the OAuth config object, the relevant auth provider will be excluded from the UI.\n6. Execute `DeviceFlowUI.signIn()`. This will return a **Promise\\\u003cUserCredential\\\u003e**.\n\n## How It Works\n\nGoogle has a great resource on [\"OAuth 2.0 for TV and Limited-Input Device Applications\"](https://developers.google.com/identity/protocols/oauth2/limited-input-device#obtaining-oauth-2.0-access-tokens).\n\n![Device Flow Diagram](https://developers.google.com/identity/protocols/images/oauth2/device/flow.png)\n\n# Development\n\nBuild and test with the usual `npm run build`, `npm run test`. For testing, you will have to initialize your own Firebase app and provider support.\n\n## Requirements\n\n- Node.js and `npm`\n- Dependencies (install with `npm install`)\n\n## Todo\n\n- [X] Convert to Typescript\n- [X] Change package structure for easier import (currently `import { DeviceFlowUI } from 'FirebaseDeviceFlow/dist/FirebaseDeviceFlow';`)\n- [X] Fix testing\n- [ ] 'Slow down' error code handling?\n- [ ] Add more providers?\n\n[![firebase](https://firebase.google.com/downloads/brand-guidelines/SVG/logo-built_white.svg)](https://firebase.google.com/)\n\n# FAQ\n\n## I'm getting X error, wtf is going on?\n\nMake sure you've done the following:\n\n1. **All** per-provider setup (outlined above)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeapodtechnologies%2Ffirebasedeviceflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeapodtechnologies%2Ffirebasedeviceflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeapodtechnologies%2Ffirebasedeviceflow/lists"}