{"id":20745286,"url":"https://github.com/techins-software/ezfirebase","last_synced_at":"2026-06-29T05:31:51.087Z","repository":{"id":240198899,"uuid":"801609481","full_name":"TechIns-Software/ezfirebase","owner":"TechIns-Software","description":"A library that allows you to bootstrap firebase FMC message and display them as browser notifications. ","archived":false,"fork":false,"pushed_at":"2024-06-10T12:46:25.000Z","size":526,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-11T12:51:56.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/TechIns-Software.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.MD","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-16T15:04:38.000Z","updated_at":"2024-06-10T12:46:16.000Z","dependencies_parsed_at":"2024-05-17T09:32:58.364Z","dependency_job_id":"03863696-e9cc-434b-8511-60f771a6c15f","html_url":"https://github.com/TechIns-Software/ezfirebase","commit_stats":null,"previous_names":["techins-software/ezfirebase"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/TechIns-Software/ezfirebase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechIns-Software%2Fezfirebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechIns-Software%2Fezfirebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechIns-Software%2Fezfirebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechIns-Software%2Fezfirebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechIns-Software","download_url":"https://codeload.github.com/TechIns-Software/ezfirebase/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechIns-Software%2Fezfirebase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34915001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-17T07:19:28.528Z","updated_at":"2026-06-29T05:31:51.067Z","avatar_url":"https://github.com/TechIns-Software.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ez push notification JS lib\n\nAn api wrapper around firebase aiming to offer a trouble-free usage of firebase upon legacy es-5 projects.\n\n# Usage via CDN\n\n## Step 1: Load Js Scripot through CDN\n\n```\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/@techins/pushnotiflib@latest/dist/firebaseLib.umd.js\"\u003e\u003c/script\u003e\n```\n\n## Step 2: Create `firebase-messaging-sw.js`\n\n### Ensure that `firebase-messaging-sw.js` is servesd through `/` and via https.\n\nIn order for the firebase to work you must create a file `firebase-messaging-sw.js`. The file should be accessible via **https** at:\n\n```\nhttps://^your_domain^/firebase-messaging-sw.js\n```\n\nKeep in mind that `firebase-messaging-sw.js` **does not** work if not served in http as mentioned above.\n\n## `firebase-messaging-sw.js` content\n\nIts content should be:\n\n```\nimportScripts(\"https://cdn.jsdelivr.net/npm/@techins/pushnotiflib@latest/dist/firebase-messaging-sw.js\");\n\nconst firebaseConfig = {\n    // Replace firebase config from firebase console\n};\n\nself.initServiceWorker(firebaseConfig);\n```\n\nThe `firebaseConfig` is the config generated from the firebase console.\n\n## Step 3 Use the library:\n\nThe library can be used like this:\n\n```\nconst firebaseConfig = {\n    // Firebase config\n};\n            \n\nconst vapidKey = \"\"; // Also generated from firebase console\n\n// Initialize Firebase  \nfirebaseLib.pushNotificationInit(firebaseConfig,vapidKey)\n```\n\nBoth `firebaseConfig` and `vapidKey` are retrieved from firebase console.\n\n# Further token reiceival handling:\n\nThe function `pushNotificationInit` recieves the folloing arguments (with rthe order provided):\n\n* `firebaseConfig` that is the configuration received from firebase console\n* `vapidKey` that also received via firebase console\n* `tokenNotificationCallback` As documented bellow (optional)\n* `workerAsModule` that indicates whether worker should be loaded as a module or not.\n\n\nUpon token receival you can offer to be processed futher via providing a callback function at `tokenNotificationCallback`. \nThe function provided should be like this:\n\n```\nfunction(token,proceedCallback)\n{\n  // Send token via ajax or do stuff\n}\n```\n\nIn order to receive messages you must call `proceedCallback` function. In order to indicate that the process sucessfully has been ended you should do:\n\n```\nfunction(token,proceedCallback)\n{\n  // Send token via ajax or do stuff\n  proceedCallback() // Success\n}\n```\n\nOtherwise you should provide the error as an argument:\n\n```\nfunction(token,proceedCallback)\n{\n  // Send token via ajax or do stuff\n  proceedCallback() // Success\n}\n```\n\nA full working example is:\n\n```\nconst firebaseConfig = {\n    // Firebase config\n};\n            \n\nconst vapidKey = \"\"; // Also generated from firebase console\n\nfunction handleToken(token,proceedCallback)\n{\n  // Send token via ajax or do stuff\n  proceedCallback()\n}\n\n// Initialize Firebase  \nfirebaseLib.pushNotificationInit(firebaseConfig,vapidKey,handleToken)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechins-software%2Fezfirebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechins-software%2Fezfirebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechins-software%2Fezfirebase/lists"}