{"_id":"@azroberts/easy-firebase-admin","_rev":"4-68ab86da7589eff7c248f2ee8c8cbc50","name":"@azroberts/easy-firebase-admin","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@azroberts/easy-firebase-admin","version":"1.0.0","keywords":["firebase"],"author":{"name":"Andrew Roberts"},"license":"ISC","_id":"@azroberts/easy-firebase-admin@1.0.0","maintainers":[{"name":"azroberts","email":"andrew@azroberts.com"}],"homepage":"https://github.com/azroberts8/easy-firebase-admin#readme","bugs":{"url":"https://github.com/azroberts8/easy-firebase-admin/issues"},"dist":{"shasum":"446ab17c3b82e821a1cbf063d5ecd7f0e3048e89","tarball":"https://registry.npmjs.org/@azroberts/easy-firebase-admin/-/easy-firebase-admin-1.0.0.tgz","fileCount":4,"integrity":"sha512-/knPG0AUHZQlCN8Tb6u2LNa7j4QejlrjtQrl8itWAL+2R8keapDkHaut+LCw8G2LhK0s1+Xz+6SJk/CbAR12eQ==","signatures":[{"sig":"MEQCIDeFin8I4y43iKCzfQPIyZM26szOM0LIH7vd51EjY10tAiA6IF+1eMWJVoy0CyW+bH4dnbehryq+zrvkekftlMAOxA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3110},"main":"./src/index.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a3277831ca79d248fd47a903db11034947d5b3b1","scripts":{"build":"tsc"},"_npmUser":{"name":"azroberts","email":"andrew@azroberts.com"},"repository":{"url":"git+https://github.com/azroberts8/easy-firebase-admin.git","type":"git"},"_npmVersion":"11.1.0","description":"A firebase admin wrapper to simplify setup and initializatio","directories":{},"_nodeVersion":"23.6.0","dependencies":{"typescript":"^5.8.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/easy-firebase-admin_1.0.0_1744920940375_0.017738408904022673","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@azroberts/easy-firebase-admin","version":"1.0.1","keywords":["firebase"],"author":{"name":"Andrew Roberts"},"license":"ISC","_id":"@azroberts/easy-firebase-admin@1.0.1","maintainers":[{"name":"azroberts","email":"andrew@azroberts.com"}],"homepage":"https://github.com/azroberts8/easy-firebase-admin#readme","bugs":{"url":"https://github.com/azroberts8/easy-firebase-admin/issues"},"dist":{"shasum":"8f3c9bc0d61488c74a357c806c537cea87014376","tarball":"https://registry.npmjs.org/@azroberts/easy-firebase-admin/-/easy-firebase-admin-1.0.1.tgz","fileCount":4,"integrity":"sha512-s1gO8f6XGgtLHnKX4NnV+BusUwo2Sgy8HcqtaEOnPegbKK+g1RN7ZScmCRuhKebYQzSJFNMYyRwwyg9fW07vVg==","signatures":[{"sig":"MEQCIATQVRnZjpMTUcdHhYD5Z5QTFK5fALqpu/MX3rJG4kAUAiA97rH8S92FVNW919l0C8g7ug9ugaCwHqyvuNA+uLQBpw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3111},"main":"./src/index.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"26181fedfb709bc07e35c28c8af1c9e408dab03b","scripts":{"build":"tsc"},"_npmUser":{"name":"azroberts","email":"andrew@azroberts.com"},"repository":{"url":"git+https://github.com/azroberts8/easy-firebase-admin.git","type":"git"},"_npmVersion":"11.1.0","description":"A firebase admin wrapper to simplify setup and initialization","directories":{},"_nodeVersion":"23.6.0","dependencies":{"typescript":"^5.8.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/easy-firebase-admin_1.0.1_1744921567620_0.9953836084321055","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@azroberts/easy-firebase-admin","version":"1.0.2","keywords":["firebase"],"author":{"name":"Andrew Roberts"},"license":"ISC","_id":"@azroberts/easy-firebase-admin@1.0.2","maintainers":[{"name":"azroberts","email":"andrew@azroberts.com"}],"homepage":"https://github.com/azroberts8/easy-firebase-admin#readme","bugs":{"url":"https://github.com/azroberts8/easy-firebase-admin/issues"},"dist":{"shasum":"1f12e899c5c594207c0e14cd6b67c71b550541ed","tarball":"https://registry.npmjs.org/@azroberts/easy-firebase-admin/-/easy-firebase-admin-1.0.2.tgz","fileCount":5,"integrity":"sha512-1iVGdqWShe33uqrBb0zid9CeeTK+pFECNLg8No5O2QTyIaMTEf+Fxs+zvxjVoGU+bjL5wiFpsDB5yjO+nusfog==","signatures":[{"sig":"MEUCIQCTYuEkMl1pqkN1QprPU4WUMJxSgoglq+T58BbELCja7gIgMrejmT5Vt6jI6KQanhhUtYNoLL7zUA94P2EqQaDF+Rc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3187},"main":"./src/index.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4573f41619e19824c7fe167f912718d5bc0e0474","scripts":{"build":"tsc"},"_npmUser":{"name":"azroberts","email":"andrew@azroberts.com"},"repository":{"url":"git+https://github.com/azroberts8/easy-firebase-admin.git","type":"git"},"_npmVersion":"11.1.0","description":"A firebase admin wrapper to simplify setup and initialization","directories":{},"_nodeVersion":"23.6.0","dependencies":{"typescript":"^5.8.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/easy-firebase-admin_1.0.2_1744921741593_0.5923454452710557","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@azroberts/easy-firebase-admin","version":"1.0.3","description":"A firebase admin wrapper to simplify setup and initialization","keywords":["firebase","env","environment variables","authentication","admin"],"homepage":"https://github.com/azroberts8/easy-firebase-admin#readme","bugs":{"url":"https://github.com/azroberts8/easy-firebase-admin/issues"},"repository":{"type":"git","url":"git+https://github.com/azroberts8/easy-firebase-admin.git"},"license":"ISC","author":{"name":"Andrew Roberts"},"type":"module","main":"./src/index.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","test":"tsc && node test.js"},"dependencies":{"@types/node":"^22.14.1","dotenv":"^16.5.0","firebase-admin":"^13.2.0","typescript":"^5.8.3"},"_id":"@azroberts/easy-firebase-admin@1.0.3","gitHead":"83cea20fbfd37773aefba60614da3899075a4d2d","_nodeVersion":"23.6.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-J4wrmQsaR+jvLuFXNLYq3yUsNqfHdgPWYmVMF9bnyRmVHYiSEMA5sNOT19qkeT5PitINk4SseOmp3FcUR8fLtA==","shasum":"731907667426bca4f37e54d222a1f008adbd2f36","tarball":"https://registry.npmjs.org/@azroberts/easy-firebase-admin/-/easy-firebase-admin-1.0.3.tgz","fileCount":7,"unpackedSize":6405,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBWol+4P/3i175BU7X4dnnUY/QimsGAbS1UlhTjahW/OAiEArQtUZF6depvJqEqTBOCmPt5xiad7QoUfFnxHw/ZKLQk="}]},"_npmUser":{"name":"azroberts","email":"andrew@azroberts.com"},"directories":{},"maintainers":[{"name":"azroberts","email":"andrew@azroberts.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/easy-firebase-admin_1.0.3_1744930075457_0.5699444444447086"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-17T20:15:40.284Z","modified":"2025-04-17T22:47:55.812Z","1.0.0":"2025-04-17T20:15:40.622Z","1.0.1":"2025-04-17T20:26:07.789Z","1.0.2":"2025-04-17T20:29:01.779Z","1.0.3":"2025-04-17T22:47:55.651Z"},"bugs":{"url":"https://github.com/azroberts8/easy-firebase-admin/issues"},"author":{"name":"Andrew Roberts"},"license":"ISC","homepage":"https://github.com/azroberts8/easy-firebase-admin#readme","keywords":["firebase","env","environment variables","authentication","admin"],"repository":{"type":"git","url":"git+https://github.com/azroberts8/easy-firebase-admin.git"},"description":"A firebase admin wrapper to simplify setup and initialization","maintainers":[{"name":"azroberts","email":"andrew@azroberts.com"}],"readme":"# Easy Firebase Admin\nA firebase admin wrapper to simplify setup and initialization. Why not just use enviornment variables?  \n\n## About\nTypically, connecting firebase admin to your RTDB requires storing a `service-account.json` file in your project directory with the credentials to your firebase. This has several issues.\n\n- Must add to `.gitignore` to prevent exposing credentials\n- Annoying to import when using ESM\n- Difficult to implement in automated deployments (environment variables are easier)\n\nThis package removes the overhead of firebase initialization from your project and allows you to store your service account JSON as a string environment variable instead. This prevents accidentally committing it to your repository and simplifies your deployments by removing the need to write a file to your project in deployment. (bad practice)\n\n## Installation\n```bash\nnpm i @azroberts/easy-firebase-admin\n```\n\n## Usage\nStore your Firebase service account as a string environment variable. (Also compatible with .env files)\n```\nFIREBASE_SERVICE_ACCOUNT='{\n  \"type\": \"service_account\",\n  \"project_id\": \"\",\n  \"private_key_id\": \"\",\n  \"private_key\": \"\",\n  \"client_email\": \"\",\n  \"client_id\": \"\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://oauth2.googleapis.com/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"\",\n  \"universe_domain\": \"googleapis.com\"\n}'\n```\n\nInitialize a connection to your Firebase Realtime Database and use as normal\n```js\nimport { getFirebaseRTDB } from '@azroberts/easy-firebase-admin';\n\nconst database = getFirebaseRTDB(\"https://super-apply-default-rtdb.firebaseio.com\");\n\nconst ref = database.ref(\"/test\");\nref.on(\"value\", (snapshot) => {\n  console.log(snapshot.val());\n});\n````\n\n## Building\n```bash\nnpm run build\n```\n","readmeFilename":"README.md"}