{"id":13406442,"url":"https://github.com/firebase/firebase-js-sdk","last_synced_at":"2025-09-09T20:17:38.804Z","repository":{"id":37251682,"uuid":"89290483","full_name":"firebase/firebase-js-sdk","owner":"firebase","description":"Firebase Javascript SDK","archived":false,"fork":false,"pushed_at":"2025-05-12T20:24:07.000Z","size":142196,"stargazers_count":4965,"open_issues_count":698,"forks_count":929,"subscribers_count":197,"default_branch":"main","last_synced_at":"2025-05-12T20:47:46.848Z","etag":null,"topics":["firebase","firebase-auth","firebase-authentication","firebase-cloud-messaging","firebase-database","firebase-db","firebase-messaging","firebase-realtime-database","firebase-storage","javascript","real-time","typescript"],"latest_commit_sha":null,"homepage":"https://firebase.google.com/docs/web/setup","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/firebase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-24T21:52:11.000Z","updated_at":"2025-05-12T19:43:49.000Z","dependencies_parsed_at":"2024-03-25T16:01:51.957Z","dependency_job_id":"a5018586-54bb-49d5-a3f1-c502b6cf8346","html_url":"https://github.com/firebase/firebase-js-sdk","commit_stats":{"total_commits":3832,"total_committers":196,"mean_commits":"19.551020408163264","dds":0.8327244258872651,"last_synced_commit":"7bf2aec6328b06c9c7dda91354630c0d59f2b411"},"previous_names":[],"tags_count":3535,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-js-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-js-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-js-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-js-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firebase","download_url":"https://codeload.github.com/firebase/firebase-js-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929320,"owners_count":21985800,"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-cloud-messaging","firebase-database","firebase-db","firebase-messaging","firebase-realtime-database","firebase-storage","javascript","real-time","typescript"],"created_at":"2024-07-30T19:02:30.431Z","updated_at":"2025-09-09T20:17:38.796Z","avatar_url":"https://github.com/firebase.png","language":"TypeScript","readme":"# Firebase JavaScript SDK\n\n\u003c!-- BADGES --\u003e\n![Build Status](https://img.shields.io/github/actions/workflow/status/firebase/firebase-js-sdk/test-all.yml)\n[![Version](https://img.shields.io/npm/v/firebase.svg?label=version)](https://www.npmjs.com/package/firebase)\n[![Coverage Status](https://coveralls.io/repos/github/firebase/firebase-js-sdk/badge.svg?branch=main)](https://coveralls.io/github/firebase/firebase-js-sdk?branch=main)\n\u003c!-- END BADGES --\u003e\n\nThe Firebase JavaScript SDK implements the client-side libraries used by\napplications using Firebase services. This SDK is distributed via:\n\n- [CDN](https://firebase.google.com/docs/web/setup/#add-sdks-initialize)\n- [npm package](https://www.npmjs.com/package/firebase)\n\nTo get started using Firebase, see\n[Add Firebase to your JavaScript Project](https://firebase.google.com/docs/web/setup).\n\n[![Release Notes](https://img.shields.io/npm/v/firebase.svg?style=flat-square\u0026label=Release%20Notes%20for\u0026labelColor=039be5\u0026color=666)](https://firebase.google.com/support/release-notes/js)\n\n## Upgrade to Version 9\n\nVersion 9 has a redesigned API that supports tree-shaking. Read the [Upgrade Guide](https://firebase.google.com/docs/web/modular-upgrade) to learn more.\n\n## Supported Environments\n\nPlease see [Environment Support](https://firebase.google.com/support/guides/environments_js-sdk).\n\n## SDK Dev Workflow\n\n### Prerequisites\n\n#### Node.js\n\nBefore you can start working on the Firebase JS SDK, you need to have Node.js\ninstalled on your machine. As of April 19th, 2024 the team has been testing with Node.js version \n`20.12.2`, but the required version of Node.js may change as we update our dependencies.\n\nTo download Node.js visit https://nodejs.org/en/download/.\n\n_NOTE: You can use a tool like [`NVM`](https://github.com/creationix/nvm)\nor [`N`](https://github.com/tj/n) to install and manage multiple node versions_\n\n#### Yarn\n\nIn addition to Node.js we use `yarn` to facilitate multi package development.\n\nTo install `yarn` follow the instructions listed on their website:\nhttps://yarnpkg.com/en/docs/install\n\nThis repo currently supports building with yarn `1.x`. For instance, after installing yarn, run\n```bash\n$ yarn set version 1.22.11\n```\n\n#### Java\n\nThe closure compiler requires a modern Java installation. Java 11+ should be installed: https://www.oracle.com/java/technologies/downloads/#java11\n\n#### Verify Prerequisites\n\nYou can verify your setup by running the following commands in your terminal:\n\n```bash\n$ node -v\n$ yarn -v\n$ java -version\n```\n\nYour `node` version should be `20.12.2`, your `yarn` version should\nbe between `1.0.0` and `1.22.11`, and your `java` version should be `11.0` or greater.\n\n_NOTE: We will update the documentation as new versions are required, however\nfor continuing development on the SDK, staying up to date on the stable versions\nof these packages is advised_\n\n### Install Dependencies\n\nOnce you have Node.js and `yarn` installed on your machine and have validated\nthat you are running the proper version, you can set up the development environment\nby running the following at the root of the SDK:\n\n```bash\n$ yarn\n```\n\nOnce you have installed all the dependencies, you can build the entire SDK by\nrunning the following command the root of the SDK:\n\n```bash\n$ yarn build\n```\n\n## Testing the SDK\n\n### Test Setup\n\nA production project is required to test the Firebase JS SDK. You can create a\nnew project by visiting the [Firebase Console](https://console.firebase.google.com/).\n\n#### Web App Setup\n\nVisit the \"Project Overview\" and select \"Add app\" under your project name. Register the app with a\nnickname and click through the remaining steps. Without performing this step, you will encounter\nthe error in the test setup:\n\n```\nFirebaseError: There are no WEB apps associated with this Firebase project\n```\n\n#### Firestore Database Setup\n\nVisit the \"Firestore Database\" section of the console and create a Cloud Firestore\ndatabase. When prompted to select the set of initial security rules, select\nany option (e.g. \"Start in Production Mode\") since these permission settings\nwill be overwritten below.\n\n#### Realtime Database Setup\n\nVisit the \"Realtime Database\" section of the console and create a realtime\ndatabase. When prompted to select the set of initial security rules, select\nany option (e.g. \"Start in Locked Mode\") since these permission settings\nwill be overwritten below.\n\n#### Storage Setup\n\nVisit the \"Storage\" section of the console and create a storage bucket. In \norder to run the tests, you will need to update your bucket's CORS rules.\n\n1. Create a new file called `cors.json` with the contents:\n```json\n[\n    {\n        \"origin\": [\"http://localhost:8089\"],\n        \"method\": [\"GET\"],\n        \"maxAgeSeconds\": 3600\n    }\n]\n```\n1. Install `gsutil` from https://cloud.google.com/storage/docs/gsutil_install\n1. You will need to login if this is your first time using `gsutil`. Run `gcloud auth login`\nand follow the instructions to login.\n1. Run `gsutil cors set cors.json gs://\u003cyour-cloud-storage-bucket\u003e`\n\nFor more information, visit https://firebase.google.com/docs/storage/web/download-files#cors_configuration\n\nThen, make sure you have anonymous sign-in provider enabled:\n\n#### Authentication Support\n\nVisit the authentication config in your project and enable the `Anonymous`\nsign-in provider to complete your project config.\n\n#### Automated Setup\n\nThe tests need to be configured to use the Firebase production project that you\ncreated in the \"Test Setup\" section above. To do this, run the `yarn test:setup`\ncommand, as follows:\n\n\n```bash\n# Select the Firebase project via the text-based UI. This will run tools/config.js\n# and deploy from config/ to your Firebase project.\n$ yarn test:setup\n\n# Specify the Firebase project via the command-line arguments.\n$ yarn test:setup --projectId=\u003ctest_firebase_project_id\u003e\n```\n\nIf you see an error like\n```\nHTTP Error: 404, Project '\u003ctest_firebase_project_id\u003e' does not exist.\n```\nthen make sure that you have created the database as specified in the \"Firestore\nDatabase Setup\" section above.\n\n### Running the tests\n\nEach of the directories in the `integration` directory as well as the `packages`\ndirectory have their own test suites. You will need to build the SDK before\nrunning tests. Test suites can be run all together by running the following \ncommand at the root of the package:\n\n```bash\n$ yarn test\n```\n\nIn addition, you can run any of the tests individually by running `yarn test` in\nan individual package directory.\n\n## Building the SDK\n\n### Introduction\n\nThe Firebase JS SDK is built with a series of individual packages that are all\ncontained in this repository. Development is coordinated via [yarn\nworkspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) and\n[Lerna](https://lerna.js.org/) (a monorepo management tool).\n\nEach package in the `packages` directory, constitute a piece of our\nimplementation. The SDK is built via a combination of all of these packages\nwhich are published under the [`firebase`\nscope](https://www.npmjs.com/search?q=scope%3Afirebase) on NPM.\n\n### Testing the SDK Locally\n\nPlease be sure your product's package has been built before proceeding any further. (If you haven't built this repo before, make sure to run `yarn build` at the root)\nIn order to manually test your SDK changes locally, you must use [yarn link](https://classic.yarnpkg.com/en/docs/cli/link):\n\n```shell\n$ cd packages/firebase\n$ yarn link # initialize the linking to the other folder\n$ cd ../\u003cmy-product\u003e # Example: $ cd ../firestore\n$ yarn link # link your product to make it available elsewhere\n$ cd \u003cmy-test-app-dir\u003e # cd into your personal project directory\n$ yarn link firebase @firebase/\u003cmy-product\u003e # tell yarn to use the locally built firebase SDK instead\n```\n\nThis will create a symlink and point your `\u003cmy-test-app-dir\u003e` to the locally built version of the firebase SDK.\n\n### Helper Scripts\n\nEach package in the `packages` directory exposes a `dev` script. This script\nwill set up a watcher for development on the individual piece of the SDK. In\naddition, there is a top level `dev` script that can be run to start all of the\nwatch tasks as well as a sandbox server.\n\nYou can run the dev script by running the following at the root of the package:\n\n```bash\n$ yarn dev\n```\n\n### Prepush Hooks\n\nAs part of this repo, we use the NPM package [`husky`](https://npm.im/husky) to\nimplement git hooks. We leverage the prepush hook to do two things:\n\n- Automated code styling (using [`prettier`](https://npm.im/prettier))\n- Automated LICENSE header insertion\n\n## Contributing\n\nSee [Contributing](./CONTRIBUTING.md) for more information on contributing to the Firebase\nJavaScript SDK.\n\n### Big Thanks\n\nCross-browser Testing Platform and Open Source \u003c3 Provided by [Sauce Labs][homepage]\n\n[homepage]: https://saucelabs.com\n","funding_links":[],"categories":["TypeScript","Node JS"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Ffirebase-js-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebase%2Ffirebase-js-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Ffirebase-js-sdk/lists"}