{"id":44643170,"url":"https://github.com/uphy/firestore-seed","last_synced_at":"2026-02-14T19:08:03.039Z","repository":{"id":26650164,"uuid":"109454243","full_name":"uphy/firestore-seed","owner":"uphy","description":"Seed data library for Cloud Firestore.","archived":false,"fork":false,"pushed_at":"2022-06-02T22:30:54.000Z","size":750,"stargazers_count":26,"open_issues_count":18,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T09:06:07.345Z","etag":null,"topics":["firebase","firestore","seed"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/firestore-seed","language":"TypeScript","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/uphy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-04T00:20:59.000Z","updated_at":"2024-01-13T17:44:14.000Z","dependencies_parsed_at":"2022-08-26T15:11:32.893Z","dependency_job_id":null,"html_url":"https://github.com/uphy/firestore-seed","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/uphy/firestore-seed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphy%2Ffirestore-seed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphy%2Ffirestore-seed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphy%2Ffirestore-seed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphy%2Ffirestore-seed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uphy","download_url":"https://codeload.github.com/uphy/firestore-seed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphy%2Ffirestore-seed/sbom","scorecard":{"id":911379,"data":{"date":"2025-08-11","repo":{"name":"github.com/uphy/firestore-seed","commit":"63fc4ed8807f867a72b4c160eaddf7e53b7382a4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 1/17 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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 'master'"],"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 2 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":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fpm5-vv97-jfwg","Warn: Project is vulnerable to: GHSA-4g6q-77j7-vvjc","Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9","Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-rvg8-pwq2-xj7q","Warn: Project is vulnerable to: GHSA-r92x-f52r-x54g","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-wgfq-7857-4jcc","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-v9mx-4pqq-h232","Warn: Project is vulnerable to: GHSA-4j66-8f4r-3pjx"],"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-24T19:19:50.176Z","repository_id":26650164,"created_at":"2025-08-24T19:19:50.176Z","updated_at":"2025-08-24T19:19:50.176Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["firebase","firestore","seed"],"created_at":"2026-02-14T19:08:02.476Z","updated_at":"2026-02-14T19:08:03.030Z","avatar_url":"https://github.com/uphy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firestore-seed\n\n`firestore-seed` insert initial seed data to [Cloud Firestore](https://firebase.google.com/docs/firestore/).\n\nNot tested at all.  Use this at your own lisk.\n\n## Getting started\n\nAdd firestore-seed to your project.\n\n```sh\n$ yarn add firestore-seed\n```\n\nCreate a simple seed program.\n\n```javascript\nconst admin = require(\"firebase-admin\");\n// serviceAccountKey.json can be generated in Firebase Console.\nconst serviceAccountKey = require(\"./serviceAccountKey.json\");\nconst seed = require('firestore-seed');\n\n// Initialize firebase-admin.\nadmin.initializeApp({\n    credential: admin.credential.cert(serviceAccountKey),\n    databaseURL: \"https://xxxxxx.firebaseio.com\",\n    storageBucket: \"xxxxxx.appspot.com\",\n});\n\n// Import seeds.\nlet messagesCollection = seed.collection(\"messages\", [\n    seed.doc(\"message1\", {\n        content: \"Hello firestore-seed.\",\n        created: new Date(),\n    }),\n    seed.doc(\"message2\", {\n        content: \"Good bye firestore-seed.\",\n        created: new Date(),\n    })\n]);\n\nmessagesCollection.importDocuments(admin).then(() =\u003e {\n    console.log(\"Successfully imported documents.\");\n}).catch(e =\u003e {\n    console.log(\"Failed to import documents: \" + e);\n});\n```\n\n## Uploading files\n\nYou can also upload files to the Firebase Cloud Storage and add the download URL to the Firestore documents.\n\n```javascript\nconst admin = require(\"firebase-admin\");\n// serviceAccountKey.json can be generated in Firebase Console.\nconst serviceAccountKey = require(\"./serviceAccountKey.json\");\nconst seed = require('firestore-seed');\n\n// Initialize firebase-admin\nadmin.initializeApp({\n    credential: admin.credential.cert(serviceAccount),\n    databaseURL: \"https://xxxxxx.firebaseio.com\",\n    storageBucket: \"xxxxxx.appspot.com\",\n});\n\n// Import seeds.\nlet imageOptions = seed.imageOptions(\"images/{id}\", \"public/profiles/{id}\")\nlet profilesCollection = seed.collection(\"profiles\", [\n    seed.doc(\"uphy\", {\n        name: \"foo\",\n        introduction: \"Hello, I'm foo.\",\n        created: new Date(),\n        // Upload 'images/uphy/image.png' to 'public/profiles/uphy/image.png' and set its' download URL to this field.\n        icon: seed.image(\"image.png\", \"image.png\", imageOptions)\n    }),\n    seed.doc(\"yhpu\", {\n        name: \"bar\",\n        introduction: \"Hello, I'm bar.\",\n        content: \"Good bye firestore-seed.\",\n        created: new Date(),\n        // Upload 'images/yhpu/image.png' to 'public/profiles/yhpu/image.png' and set its' download URL to this field.\n        icon: seed.image(\"image.png\", \"image.png\", imageOptions)\n    })\n]);\n\nprofilesCollection.importDocuments(admin).then(() =\u003e {\n    console.log(\"Successfully imported documents.\");\n}).catch(e =\u003e {\n    console.log(\"Failed to import documents: \" + e);\n});\n```\n\n## Subcollections\n\nFor inserting subcollections, use `seed.subcollection(docs)`.\n\n```javascript\nconst admin = require(\"firebase-admin\");\n// serviceAccountKey.json can be generated in Firebase Console.\nconst serviceAccountKey = require(\"./serviceAccountKey.json\");\nconst seed = require('firestore-seed');\n\n// Initialize firebase-admin\nadmin.initializeApp({\n    credential: admin.credential.cert(serviceAccount),\n    databaseURL: \"https://xxxxxx.firebaseio.com\",\n    storageBucket: \"xxxxxx.appspot.com\",\n});\n\n// Import seeds.\nseed.importCollections(admin,\n    [\n        seed.collection(\"users\", [\n            seed.doc(\"uphy\", {\n                name: 'Yuhi Ishikura',\n                rooms: seed.subcollection([\n                    seed.doc(\"room1\", {\n                        \"ref\": seed.docRef(\"rooms\", \"room1\")\n                    }),\n                    seed.doc(\"room2\", {\n                        \"ref\": seed.docRef(\"rooms\", \"room2\")\n                    })\n                ])\n            }),\n            seed.doc(\"suzuki\", {\n                name: 'Taro Suzuki',\n                rooms: seed.subcollection([\n                    seed.doc(\"room1\", {\n                        \"ref\": seed.docRef(\"rooms\", \"room1\")\n                    }),\n                    seed.doc(\"room2\", {\n                        \"ref\": seed.docRef(\"rooms\", \"room2\")\n                    })\n                ]),\n            }),\n            seed.doc(\"tanaka\", {\n                name: 'Tanaka Jiro',\n                rooms: seed.subcollection([\n                    seed.doc(\"room2\", {\n                        \"ref\": seed.docRef(\"rooms\", \"room2\")\n                    })\n                ]),\n            })\n        ]),\n        seed.collection(\"rooms\", [\n            seed.doc(\"room1\", {\n                name: \"Room 1\",\n                messages: seed.subcollection([\n                    seed.doc(\"message1\", {\n                        time: Date.now(),\n                        content: \"Message 1 of room1\",\n                        user: seed.docRef(\"users\", \"uphy\")\n                    }),\n                    seed.doc(\"message2\", {\n                        time: Date.now(),\n                        content: \"Message 2 of room1\",\n                        user: seed.docRef(\"users\", \"suzuki\")\n                    })\n                ])\n            }),\n            seed.doc(\"room2\", {\n                name: \"Room 2\",\n                messages: seed.subcollection([\n                    seed.doc(\"message1\", {\n                        time: Date.now(),\n                        content: \"Message 1 of room2\",\n                        user: seed.docRef(\"users\", \"uphy\")\n                    }),\n                    seed.doc(\"message2\", {\n                        time: Date.now(),\n                        content: \"Message 2 of room2\",\n                        user: seed.docRef(\"users\", \"suzuki\")\n                    }),\n                    seed.doc(\"message3\", {\n                        time: Date.now(),\n                        content: \"Message 3 of room2\",\n                        user: seed.docRef(\"users\", \"tanaka\")\n                    })\n                ])\n            })\n        ])\n    ]\n).then(() =\u003e {\n    console.log(\"Successfully imported documents.\");\n}).catch(e =\u003e {\n    console.log(\"Failed to import documents: \" + e);\n});\n```\n\n## Predefined script\n\nYou can use firestore-seed more simply with npm scripts.\n\n1. `yarn add -D firestore-seed`\n2. Create seed file\n   ```javascript\n   const seed = require('firestore-seed');\n\n   // Export collection or collection array.\n   module.exports = seed.collection(\"messages\", [\n       seed.doc(\"message1\", {\n           content: \"Hello firestore-seed.\",\n           created: new Date(),\n       }),\n       seed.doc(\"message2\", {\n           content: \"Good bye firestore-seed.\",\n           created: new Date(),\n       })\n   ]);\n   ```\n3. Add following properties to your `package.json`\n   ```json\n   \"scripts\": {\n       \"seed\": \"firestore-seed\",\n       /* ... */\n   },\n   /* ... */\n   \"firestore-seed\": {\n       /* Firestore database URL(required) */\n       \"databaseURL\": \"https://xxxxxxx.firebaseio.com\",\n       /* Firebase service account key file. */\n       \"credentialPath\": \"./firebase-credential.json\",\n       /* Firestore seed file created in #2 */\n       \"seedDataPath\": \"./firestore-seed.js\"\n   }\n   ```\n4. Run `yarn seed`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphy%2Ffirestore-seed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuphy%2Ffirestore-seed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphy%2Ffirestore-seed/lists"}