{"id":15905710,"url":"https://github.com/jsayol/rxfirebase","last_synced_at":"2025-06-17T01:03:02.422Z","repository":{"id":91866457,"uuid":"76811517","full_name":"jsayol/rxfirebase","owner":"jsayol","description":"RxJS wrapper with extra goodies for the Firebase JavaScript SDK","archived":false,"fork":false,"pushed_at":"2016-12-30T14:44:54.000Z","size":28,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-06T22:29:17.196Z","etag":null,"topics":["firebase","javascript","reactive-programming","rxjs","rxjs-wrapper","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsayol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-18T22:53:56.000Z","updated_at":"2021-09-07T14:02:53.000Z","dependencies_parsed_at":"2023-06-10T03:45:44.493Z","dependency_job_id":null,"html_url":"https://github.com/jsayol/rxfirebase","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"7c8fa2bab42eed48eb943e5ee23c64ea47343120"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jsayol/rxfirebase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsayol%2Frxfirebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsayol%2Frxfirebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsayol%2Frxfirebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsayol%2Frxfirebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsayol","download_url":"https://codeload.github.com/jsayol/rxfirebase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsayol%2Frxfirebase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260038636,"owners_count":22949475,"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":["firebase","javascript","reactive-programming","rxjs","rxjs-wrapper","typescript"],"created_at":"2024-10-06T13:07:13.534Z","updated_at":"2025-06-17T01:03:02.380Z","avatar_url":"https://github.com/jsayol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RxFirebase\n[![npm version](https://badge.fury.io/js/rxfirebase.svg)](https://www.npmjs.com/package/rxfirebase)\n\n[Apache 2.0 License](LICENSE.txt)\n\nRxJS wrapper with extra goodies for the Firebase JavaScript SDK.\n\n## Installation\n\nVia npm\n```\nnpm install rxjs firebase rxfirebase --save\n```\n\nVia yarn\n```\nyarn add rxjs firebase rxfirebase\n```\n\n## Usage\n\n### ES6 and TypeScript\n```ts\nimport { RxFirebase } from 'rxfirebase';\n\nconst firebaseConfig = {\n  apiKey: \"...\",\n  authDomain: \"...\",\n  databaseURL: \"...\",\n  messagingSenderId: \"...\",\n  storageBucket: \"...\",\n};\n\nRxFirebase.initializeApp(firebaseConfig);\n\nconst items$ = RxFirebase.database.ref('/items').onChildAdded();\n\nitems$.subscribe(snapshot =\u003e {\n  console.log(`Child added with key ${snapshot.key} and value ${snapshot.val()}`);\n});\n\nconst secretItems$ = RxFirebase.database.ref('/super/secret/items')\n  .afterSignIn()\n  .untilSignOut()\n  .getValue()\n  .onChildRemoved();\n  \nsecretItems$.subscribe(item =\u003e {\n  // Using getValue() emits the value itself instead of the snapshot.\n  // It's equivalent to calling snapshot.val()\n  console.log(`Child removed with value ${item}`);\n});\n\nconst userPostsOnSignIn$ = RxFirebase.auth.onSignIn$.switchMap(auth =\u003e\n  RxFirebase.database.ref(`/userPosts/${auth.uid}`)\n    .asList()\n    .untilSignOut()\n    .once('value')\n);\n\nuserPostsOnSignIn$.subscribe(posts =\u003e {\n  console.log(`This user has ${posts.length} posts.`);\n  if (posts.length \u003e 0) {\n    // Using asList() emits the data as an Array with the key for each item stored as item.$key\n    // If the value is an Object then \"item\" is the value itself, otherwise\n    // it is stored in item.$value (for strings, numbers, and booleans)\n    const post = posts[0];\n    console.log(`The title for the first post, with key ${post.$key}, is \"${post.title}\"`);\n  }\n});\n\nRxFirebase.auth.isSignedIn$.subscribe(isSignedIn =\u003e {\n  console.log(`The user is ${isSignedIn ? '' : 'NOT '}signed in.`);\n});\n\nsetTimeout(() =\u003e {\n  console.log('Signing in...');\n  RxFirebase.auth.signInAnonymously();\n}, 2000);\n\nsetTimeout(() =\u003e {\n  console.log('Signing out...');\n  RxFirebase.auth.signOut();\n}, 10000);\n```\n\n### UMD (CommonJS, AMD)\n\nComing soon\n\n\n## TO-DO\n- [ ] **Add tests**\n- [x] Auth support\n- [x] Database support\n- [ ] Storage support\n- [ ] Messaging support\n- [ ] Fix building of UMD module (CommonJS, AMD)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsayol%2Frxfirebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsayol%2Frxfirebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsayol%2Frxfirebase/lists"}