{"id":16945265,"url":"https://github.com/offgriddev/fastify-cosmosdb","last_synced_at":"2026-04-10T01:33:14.009Z","repository":{"id":46381353,"uuid":"416156646","full_name":"offgriddev/fastify-cosmosdb","owner":"offgriddev","description":"CosmosDb Plugin for Fastify. Allows for a simple interface to quickly access Azure CosmosDb containers through the Fastify instance.","archived":false,"fork":false,"pushed_at":"2021-10-18T18:11:15.000Z","size":172,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T01:40:05.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/offgriddev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-10-12T02:36:28.000Z","updated_at":"2021-10-18T18:08:39.000Z","dependencies_parsed_at":"2022-08-29T05:21:31.098Z","dependency_job_id":null,"html_url":"https://github.com/offgriddev/fastify-cosmosdb","commit_stats":null,"previous_names":["jeryanders/fastify-cosmosdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/offgriddev/fastify-cosmosdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Ffastify-cosmosdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Ffastify-cosmosdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Ffastify-cosmosdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Ffastify-cosmosdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offgriddev","download_url":"https://codeload.github.com/offgriddev/fastify-cosmosdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Ffastify-cosmosdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":[],"created_at":"2024-10-13T21:21:48.353Z","updated_at":"2026-04-01T17:03:39.202Z","avatar_url":"https://github.com/offgriddev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastify-cosmosDb: Your Fastify Plugin for Azure CosmosDb\n\nThis Fastify plugin interogates your CosmosDb account to determine which containers are available and provides quick access through a Fastify Instance decoration. This plugin integrates with [@azure/cosmosdb](https://www.npmjs.com/package/@azure/cosmos) and allows you to specify the database filters to opt-in account resources.\n\n## Install\n```\nnpm i fastify-cosmosdb -S\n```\n## Usage\n\nFor unfiltered access to all cosmos containers.\n\nConfiguration without database and container filters:\n\n```js\nconst fastify = require('fastify')\n\nfastify.register(require('fastify-cosmosdb'), {\n    cosmosOptions: {\n      endpoint: 'your-account-endpoint',\n      authKey: 'auth-key'\n    }\n  })\n\nfastify.listen(3000, err =\u003e {\n  if (err) throw err\n  console.log(`server listening on ${fastify.server.address().port}`)\n})\n```\n\nConfiguration with database and container filters:\n\n```js\nconst fastify = require('fastify')\n\nfastify.register(require('fastify-cosmosdb'), {\n    cosmosOptions: {\n      endpoint: 'your-account-endpoint',\n      authKey: 'auth-key'\n    },\n    databases: [{\n      id: 'database-id',\n      containers: {\n        'container-name': true\n      }\n    }]\n  })\n\nfastify.listen(3000, err =\u003e {\n  if (err) throw err\n  console.log(`server listening on ${fastify.server.address().port}`)\n})\n```\n\n```js\nasync function singleRoute(fastify, options) {\n  fastify.get(\n    '/users/:id',\n    (request, reply) =\u003e {\n      // containers accessible through 'cosmosDbContainers'\n      return fastify.cosmos.databaseId.containerName.items('item-id', 'partition-key')\n    },\n  )\n}\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffgriddev%2Ffastify-cosmosdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffgriddev%2Ffastify-cosmosdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffgriddev%2Ffastify-cosmosdb/lists"}