{"id":19490231,"url":"https://github.com/nigeltiany/vuefire","last_synced_at":"2026-03-12T11:35:54.683Z","repository":{"id":117727963,"uuid":"98048879","full_name":"nigeltiany/vuefire","owner":"nigeltiany","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-28T14:51:34.000Z","size":1392,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-15T10:31:56.644Z","etag":null,"topics":["firebase","firebase-database","firebase-storage","vuefire","vuejs","vuex"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nigeltiany.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-22T17:59:20.000Z","updated_at":"2020-07-30T18:14:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa5c8805-0798-4400-a2a9-2a331aaf44ef","html_url":"https://github.com/nigeltiany/vuefire","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigeltiany%2Fvuefire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigeltiany%2Fvuefire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigeltiany%2Fvuefire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigeltiany%2Fvuefire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nigeltiany","download_url":"https://codeload.github.com/nigeltiany/vuefire/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224014257,"owners_count":17241281,"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-database","firebase-storage","vuefire","vuejs","vuex"],"created_at":"2024-11-10T21:11:48.208Z","updated_at":"2026-03-12T11:35:49.574Z","avatar_url":"https://github.com/nigeltiany.png","language":"JavaScript","funding_links":[],"categories":["Integrations [🔝](#readme)","积分","Components \u0026 Libraries","Integrations"],"sub_categories":["付款","Integrations","Payment"],"readme":"[Firebase](https://firebase.google.com/docs/web/setup) for [VueJS](https://vuejs.org/)\n\n## Install\n\n```bash\nnpm install @vuefire/vuefire --save\n```\n\n## Usage\n#### Configuration\n```js\nimport VueFire from '@vuefire/vuefire'\n\nVue.use(VueFire, {\n  project: {\n    apiKey: \"\u003cAPI_KEY\u003e\",\n    authDomain: \"\u003cPROJECT_ID\u003e.firebaseapp.com\",\n    databaseURL: \"https://\u003cDATABASE_NAME\u003e.firebaseio.com\",\n    storageBucket: \"\u003cBUCKET\u003e.appspot.com\",\n    messagingSenderId: \"\u003cSENDER_ID\u003e\",\n    projectId: '\u003cPROJECT_ID\u003e',\n  }\n})\n\n// In components\nmethods: {\n    this.$firebase.database().ref('/users')\n    this.$firebase.auth()\n}\n```\n\n### Using Mixins\n#### Apply mixins to firebase\n```js\nVue.use(VueFire, {\n  project: {\n    // ...\n  },\n  mixins: [\n      function specialFirebaseAction({firebase}, params){\n        // What will you create ?\n        console.log(params + ' I see you')\n        return firebase.auth().currentUser\n      }\n  ]\n})\n\n// in components\ncomputed: {\n  user() {\n    this.$firebase.specialFirebaseAction('params')\n  }\n}\n```\n\n#### Supply vuex actions a second parameter that is firebase\n```js\nimport VueFire from '@vuefire/vuefire'\n\nVue.use(VueFire, {\n  project: {\n    apiKey: \"\u003cAPI_KEY\u003e\",\n    authDomain: \"\u003cPROJECT_ID\u003e.firebaseapp.com\",\n    databaseURL: \"https://\u003cDATABASE_NAME\u003e.firebaseio.com\",\n    storageBucket: \"\u003cBUCKET\u003e.appspot.com\",\n    messagingSenderId: \"\u003cSENDER_ID\u003e\",\n    projectId: '\u003cPROJECT_ID\u003e',\n  },\n  vuex: {\n    namespaces: ['firebase'],\n    store: store\n  }\n})\n```\n```js\n// firebase namespaced module\nexport default {\n  namespaced: true,\n  /**\n    * ...your state, getter, and mutations are here\n    */  \n  actions: {\n    // and now the magic\n    saveToFirebase ({commit, rootState, state}, {firebase, database}, payload) {\n      // firebase.database() or just\n      database().ref('a/path/on/firebase'). // you know the rest\n    }\n  }\n}\n```\n```js\n// just add 'root' to namespaces array to have your root action have a firebase parameter\nvuex: {\n  namespaces: ['root', 'firebase'],\n  store: store\n}\n```\n```text\nfirebase components coming soon\n- [ ] firebase-app\n- [ ] firebase-auth\n- [x] firebase-document \n- [ ] firebase-messaging\n- [ ] firebase-query\n- [ ] firebase-storage\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigeltiany%2Fvuefire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnigeltiany%2Fvuefire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigeltiany%2Fvuefire/lists"}