{"id":21412616,"url":"https://github.com/refirebase/refirebase","last_synced_at":"2025-07-27T05:32:27.668Z","repository":{"id":257437343,"uuid":"858350793","full_name":"refirebase/refirebase","owner":"refirebase","description":"🔥 New easiest Firebase API","archived":false,"fork":false,"pushed_at":"2024-11-20T17:35:05.000Z","size":110,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-20T18:33:17.668Z","etag":null,"topics":["firebase","firebase-auth","firebase-authentication","firebase-database","firebase-firestore","firebase-realtime-database","firebase-storage"],"latest_commit_sha":null,"homepage":"https://refirebase.github.io","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/refirebase.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":"2024-09-16T18:36:51.000Z","updated_at":"2024-11-20T17:35:09.000Z","dependencies_parsed_at":"2024-11-20T18:36:37.207Z","dependency_job_id":null,"html_url":"https://github.com/refirebase/refirebase","commit_stats":null,"previous_names":["gelzinn/refirebase","gelzinn/rebase","gelzinn/refiredbase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refirebase%2Frefirebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refirebase%2Frefirebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refirebase%2Frefirebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refirebase%2Frefirebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refirebase","download_url":"https://codeload.github.com/refirebase/refirebase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227769395,"owners_count":17817119,"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","firebase-auth","firebase-authentication","firebase-database","firebase-firestore","firebase-realtime-database","firebase-storage"],"created_at":"2024-11-22T18:14:47.562Z","updated_at":"2025-07-27T05:32:27.661Z","avatar_url":"https://github.com/refirebase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/refirebase\"\u003e\n    \u003cimg src=\"https://avatars.githubusercontent.com/u/181779808?v=4\" alt=\"Refirebase Logo\" width=\"128\" style=\"border-radius: 8px\"\u003e\n    \u003ch1 align=\"center\"\u003e\n      Refirebase\n    \u003c/h1\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/refirebase\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/refirebase.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/refirebase/refirebase?tab=MIT-1-ov-file\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/refirebase.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nRefirebase is a simple library that allows you to use Firebase Realtime Database, Firestore, Storage and Authentication as a state management solution in your JavaScript application.\n\n## Installation\n\nUse your favorite package manager to install Refirebase:\n\n### NPM\n\n```bash\nnpm install refirebase\n```\n\n### Yarn, PNPM, BUN\n\n```bash\nyarn add refirebase\n```\n\n```bash\npnpm add refirebase\n```\n\n```bash\nbun add refirebase\n```\n\n## Usage\n\nImport the `Refirebase` class:\n\n```javascript\nimport { Refirebase } from 'refirebase';\n```\n\nYou can use the `Refirebase` class to get the Firebase objects:\n\n```javascript\nconst refirebase = new Refirebase({\n  apiKey: 'FIREBASE_API_KEY',\n  authDomain: 'FIREBASE_AUTH_DOMAIN',\n  databaseURL: 'FIREBASE_DATABASE_URL',\n  projectId: 'FIREBASE_PROJECT_ID',\n  storageBucket: 'FIREBASE_STORAGE_BUCKET',\n  messagingSenderId: 'FIREBASE_MESSAGING_SENDER_ID',\n  appId: 'FIREBASE_APP_ID',\n  measurementId: 'FIREBASE_MEASUREMENT_ID',\n});\n```\n\nOr you can use destructuring to get other objects:\n\n```javascript\nconst { db, auth } = new Refirebase({\n  apiKey: 'FIREBASE_API_KEY',\n  authDomain: 'FIREBASE_AUTH_DOMAIN',\n  databaseURL: 'FIREBASE_DATABASE_URL',\n  projectId: 'FIREBASE_PROJECT_ID',\n  storageBucket: 'FIREBASE_STORAGE_BUCKET',\n  messagingSenderId: 'FIREBASE_MESSAGING_SENDER_ID',\n  appId: 'FIREBASE_APP_ID',\n  measurementId: 'FIREBASE_MEASUREMENT_ID',\n});\n```\n\nIf you prefer to use directly environment variables (from `.env` file), you can simply call the constructor without any parameters:\n\n```yaml\nFIREBASE_API_KEY=\nFIREBASE_AUTH_DOMAIN=\nFIREBASE_DATABASE_URL=\nFIREBASE_PROJECT_ID=\nFIREBASE_STORAGE_BUCKET=\nFIREBASE_MESSAGING_SENDER_ID=\nFIREBASE_APP_ID=\nFIREBASE_MEASUREMENT_ID=\n```\n\n```javascript\nconst refirebase = new Refirebase();\n```\n\n## Examples\n\n### Databases\n\n#### Firestore Database Example\n```javascript\n// Import the Refirebase class\nimport { db } from '@/config/firebase';\n\n// Get all data from the 'users' collection\nconst users = db.firestore.get(\"users\");\n\n// Get data with conditions\nconst users = db.firestore.get(\"users\", {\n  where: {\n    name: \"John\",\n  },\n});\n\n// Get data with conditions and index\nconst users = db.firestore.get(\"users\", {\n  where: {\n    name: \"John\",\n    lastName: { not: \"Doe\" },\n  },\n});\n\n// Get data with conditions and not\nconst users = db.firestore.get(\"users\", {\n  where: {\n    name: \"John\",\n    age: { operator: \"\u003e=\", value: 18 },\n  },\n});\n```\n\n\u003e [!WARNING]  \n\u003e For more information about the limitations of the Firestore query, see [Firebase Firestore Query Limitations](https://firebase.google.com/docs/firestore/query-data/queries#query_limitations).\n\n#### Realtime Database Example\n\n```javascript\n// Import the Refirebase class\nimport { db } from '@/config/firebase';\n\n// Get ALL data from the 'users' collection\nconst users = db.realtime.get(\"users\");\n```\n\n#### Storage\n\n```javascript\n// Import the Refirebase class\nimport { db } from '@/config/firebase';\n\n// Get a file from the storage\nconst file = db.storage.get(\"path/to/file\");\n```\n\n### Features\n\n#### Authentication Example\n\n```javascript\n// Import the Refirebase class\nimport { auth } from '@/config/firebase';\n\n// Sign in with Google\nconst result = await auth.handleProviderSignIn(\"google\");\n\nif (!result) {\n  // Handle error\n}\n\nconst user = result.user;\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefirebase%2Frefirebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefirebase%2Frefirebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefirebase%2Frefirebase/lists"}