{"id":18032675,"url":"https://github.com/mikkopaderes/ember-firebase-service","last_synced_at":"2025-03-27T05:31:16.168Z","repository":{"id":35114201,"uuid":"109858610","full_name":"mikkopaderes/ember-firebase-service","owner":"mikkopaderes","description":"Exposes a service that's a direct representation of Firebase","archived":false,"fork":false,"pushed_at":"2022-12-07T23:34:37.000Z","size":2294,"stargazers_count":4,"open_issues_count":20,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T18:16:19.518Z","etag":null,"topics":["ember-addon","firebase"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mikkopaderes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-07T16:04:29.000Z","updated_at":"2021-08-27T17:28:03.000Z","dependencies_parsed_at":"2023-01-15T14:07:02.544Z","dependency_job_id":null,"html_url":"https://github.com/mikkopaderes/ember-firebase-service","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikkopaderes%2Fember-firebase-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikkopaderes%2Fember-firebase-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikkopaderes%2Fember-firebase-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikkopaderes%2Fember-firebase-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikkopaderes","download_url":"https://codeload.github.com/mikkopaderes/ember-firebase-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791440,"owners_count":20672665,"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":["ember-addon","firebase"],"created_at":"2024-10-30T10:15:26.600Z","updated_at":"2025-03-27T05:31:15.299Z","avatar_url":"https://github.com/mikkopaderes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ember-firebase-service\n==============================================================================\n\nExposes a service that's a direct representation of Firebase.\n\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v3.16 or above\n* Ember CLI v2.13 or above\n* Node.js v10 or above\n\n\nInstallation\n------------------------------------------------------------------------------\n\nThis addon requires `firebase`. Install the correct version of it which is listed by the command:\n\n```\nnpm info ember-firebase-service peerDependencies\n```\n\nOnce you've installed it, you can now install the addon itself:\n\n```\nember install ember-firebase-service\n```\n\n### Configuration\n\nAdd your Firebase configuration in your app's `config/environment.js`.\n\n```javascript\nlet ENV = {\n  ...\n\n  firebase: {\n    apiKey: '\u003capi_key\u003e',\n    authDomain: '\u003cauth_domain\u003e',\n    databaseURL: '\u003cdatabase_url\u003e',\n    projectId: '\u003cproject_id\u003e',\n    storageBucket: '\u003cstorage_bucket\u003e',\n    messagingSenderId: '\u003cmessaging_sender_id\u003e'\n  },\n\n  ...\n}\n```\n\nIn your `ember-cli-build.js`, there's 2 things that you need to do:\n\n1. Set the exclusion of `'firebase'` in the `ember-auto-import` settings. This is because `firebase` package is already included as a shim in this addon.\n2. Import the Firebase products that you need in your app's `ember-cli-build.js` using the format of `vendor/ember-firebase-service/firebase/firebase-\u003cproduct\u003e.js`. Note that you don't need to import `firebase-app.js` as it's automatically done for you.\n\n```javascript\n'use strict';\n\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function (defaults) {\n  const app = new EmberApp(defaults, {\n    autoImport: {\n      exclude: ['firebase']\n    }\n  });\n\n  ...\n\n  app.import('vendor/ember-firebase-service/firebase/firebase-auth.js');\n  app.import('vendor/ember-firebase-service/firebase/firebase-firestore.js');\n\n  return app.toTree();\n};\n```\n\n#### FastBoot\n\nThe Firebase products that you included in your `ember-cli-build.js` are already transformed to not run in FastBoot. This is because Firebase requires different modules when running under Node.js as opposed to the browser. To use the Node.js modules, create a FastBoot-only initializer and import it from there.\n\n```javascript\nexport function initialize() {\n  if (typeof FastBoot !== 'undefined') {\n    FastBoot.require('firebase/auth');\n    FastBoot.require('firebase/firestore');\n  }\n}\n\nexport default {\n  initialize\n};\n```\n\nUsage\n------------------------------------------------------------------------------\n\nInject the `firebase` service and use it as you would use Firebase normally.\n\n```javascript\nimport { inject as service } from '@ember/service';\nimport Component from '@ember/component';\n\nexport default class MyComponent extends Component {\n  @service firebase;\n\n  signIn() {\n    this.firebase.auth().signInWithEmailAndPassword('foo', 'bar');\n  }\n}\n```\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikkopaderes%2Fember-firebase-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikkopaderes%2Fember-firebase-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikkopaderes%2Fember-firebase-service/lists"}