{"id":40201460,"url":"https://github.com/metehankurucu/firebase-chat","last_synced_at":"2026-01-19T20:32:04.391Z","repository":{"id":46976145,"uuid":"393978744","full_name":"metehankurucu/firebase-chat","owner":"metehankurucu","description":"A small package for one-to-one messaging with Firebase.","archived":false,"fork":false,"pushed_at":"2022-02-15T15:47:07.000Z","size":1359,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T22:25:51.904Z","etag":null,"topics":["chat","firebase","firebase-chat","typescript"],"latest_commit_sha":null,"homepage":"","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/metehankurucu.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}},"created_at":"2021-08-08T14:11:04.000Z","updated_at":"2021-12-30T15:41:44.000Z","dependencies_parsed_at":"2022-07-26T17:45:57.584Z","dependency_job_id":null,"html_url":"https://github.com/metehankurucu/firebase-chat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/metehankurucu/firebase-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Ffirebase-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Ffirebase-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Ffirebase-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Ffirebase-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metehankurucu","download_url":"https://codeload.github.com/metehankurucu/firebase-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Ffirebase-chat/sbom","scorecard":{"id":638046,"data":{"date":"2025-08-11","repo":{"name":"github.com/metehankurucu/firebase-chat","commit":"d5322a3a72820268dce09f96a8efb0ad4a764410"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"22 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-3wf4-68gx-mph8","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-g954-5hwp-pp24","Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T09:50:56.231Z","repository_id":46976145,"created_at":"2025-08-21T09:50:56.232Z","updated_at":"2025-08-21T09:50:56.232Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28583840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T19:46:29.903Z","status":"ssl_error","status_checked_at":"2026-01-19T19:45:54.560Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chat","firebase","firebase-chat","typescript"],"created_at":"2026-01-19T20:32:04.256Z","updated_at":"2026-01-19T20:32:04.384Z","avatar_url":"https://github.com/metehankurucu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\n    \u003cbr/\u003e\n    \u003cbr /\u003e\n    firebase-chat\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n  \u003c/h1\u003e\n  \u003csup\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@metehankurucu/firebase-chat\"\u003e\n       \u003cimg src=\"https://img.shields.io/npm/v/@metehankurucu/firebase-chat?color=%231ABC9C\" alt=\"npm package\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@metehankurucu/firebase-chat\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dm/@metehankurucu/firebase-chat?color=%232ECC71\" alt=\"downloads\" /\u003e\n    \u003c/a\u003e\n    \u003ca\u003e\n      \u003cimg src=\"https://img.shields.io/npm/l/@metehankurucu/firebase-chat\" alt=\"license\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://badgen.net/badge/-/TypeScript/blue?icon=typescript\u0026label\" alt=\"typescript\" /\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ch3\u003e\n    A small package for one-to-one messaging with Firebase.\n    \u003c/h3\u003e\n  \u003c/sup\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n\u003c!-- # `@metehankurucu/firebase-chat` --\u003e\n\n- [Install](#getting-started)\n- [Usage](#usage)\n- [API](#api)\n\n## Getting started\n\nInstall the library:\n\n```\nyarn add @metehankurucu/firebase-chat\n```\n\nor npm:\n\n```\nnpm install --save @metehankurucu/firebase-chat\n```\n\n## Usage\n\n#### Step 1 - Initialize FirebaseChat\n\n```js\nimport FirebaseChat from '@metehankurucu/firebase-chat';\n\n// Optional. Use if firebase not initialized before\nconst firebaseConfig = {\n  apiKey: '',\n  authDomain: '',\n  projectId: '',\n  storageBucket: '',\n  messagingSenderId: '',\n  appId: '',\n  measurementId: '',\n};\n\nconst options = {\n  collectionPrefix: 'chat', // optional. collection names will be 'chatmessages' and 'chatrooms'\n};\n\nFirebaseChat.initialize({}, firebaseConfig);\n\n// Or set collection prefixes\nFirebaseChat.initialize(options, firebaseConfig);\n\n// Or give custom firestore instance (for example using library in React Native)\nimport firestore from '@react-native-firebase/firestore';\n\nFirebaseChat.initialize({}, firebaseConfig, firestore());\n```\n\nFirebaseChat must initialize only one time. You can check if it is initialized.\n\n```js\nif (!FirebaseChat.isInitialized) {\n  FirebaseChat.initialize({}, firebaseConfig);\n}\n```\n\n#### Step 2 - Set Current User Id\n\n```js\nimport FirebaseChat from '@metehankurucu/firebase-chat';\n\nFirebaseChat.setUser(userId);\n\n// Or you can combine two steps\nFirebaseChat.initialize({}, firebaseConfig).setUser(userId);\n```\n\n#### Rooms\n\n```js\nconst rooms = FirebaseChat.rooms();\n```\n\nListen current user's rooms\n\n```js\nconst unsubscribe = rooms.listenRooms(async (items) =\u003e {\n  // Do some stuff\n});\n```\n\nGet a room\n\n```js\n// Get a room with other user id\nconst room = rooms.getRoom(otherUserId);\n// Or room can create if not exists\nconst room = rooms.getRoom(otherUserId, { createIfNotExists: true });\n```\n\nDelete a room\n\n```js\nrooms.deleteRoom(room.id);\n```\n\nCreate a room\n\n```js\nrooms.createRoom(otherUserId);\n```\n\nNote: Recommended way to create a room using getRoom with createIfNotExists option.\n\n```js\nconst room = rooms.getRoom(otherUserId, { createIfNotExists: true });\n```\n\nGet collection. If you want to use collection to run custom operations.\n\n```js\n// Firestore collection instance\nconst roomsCollection = rooms.collection();\n```\n\n#### Messages\n\n```js\nconst room = await rooms.getRoom(otherUserId, { createIfNotExists: true });\n\nconst messages = FirebaseChat.messages(room.id);\n```\n\nSend message\n\n```js\nconst message = messages.sendMessage('Hey!');\n// Optional mediaURL\nconst message = messages.sendMessage('Did you see this meme?', 'pic-url');\n```\n\nNote: Sending message will update current room's `lastMessage` field.\n\nListen this room's messages\n\n```js\n// For example listen messages with first get last 50 messages\nconst unsubscribe = messages.listenMessages({ limit: 50 }, (items) =\u003e {});\n```\n\nGet this room's messages\n\n```js\nconst messagesList = await messages.getMessages({ limit: 50 });\n```\n\nGet other user id\n\n```js\nconst otherUserId = messages.getOtherUserId();\n```\n\nOn read a message. This will update this message's `read` field as `true`.\n\n```js\nawait messages.onReadMessage(messageId);\n```\n\nOn read all messages. This will update all messages sent by other user `read` field as `true`.\n\n```js\nawait messages.onReadAllMessages();\n```\n\nDelete a message\n\n```js\nawait messages.deleteMessage(messageId);\n```\n\nDelete all messages of room\n\n```js\nawait messages.deleteMessage(messageId);\n```\n\nGet collection. If you want to use collection to run custom operations.\n\n```js\n// Firestore collection instance\nconst messagesCollection = messages.collection();\n```\n\n## API\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetehankurucu%2Ffirebase-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetehankurucu%2Ffirebase-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetehankurucu%2Ffirebase-chat/lists"}