{"id":23020957,"url":"https://github.com/osskit/fastify-enforce-headers","last_synced_at":"2026-04-18T11:02:14.405Z","repository":{"id":37483585,"uuid":"504895388","full_name":"osskit/fastify-enforce-headers","owner":"osskit","description":"Enforce headers to your Fastify API calls","archived":false,"fork":false,"pushed_at":"2024-10-16T11:21:29.000Z","size":224,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T09:49:07.030Z","etag":null,"topics":["authorization","fastify","fastify-plugin","headers","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osskit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2022-06-18T16:31:39.000Z","updated_at":"2024-10-16T11:21:32.000Z","dependencies_parsed_at":"2024-10-18T00:41:37.250Z","dependency_job_id":null,"html_url":"https://github.com/osskit/fastify-enforce-headers","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"d720700f81d24e12a923c3e3ef028b05d8b46fd3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osskit/fastify-enforce-headers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osskit%2Ffastify-enforce-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osskit%2Ffastify-enforce-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osskit%2Ffastify-enforce-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osskit%2Ffastify-enforce-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osskit","download_url":"https://codeload.github.com/osskit/fastify-enforce-headers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osskit%2Ffastify-enforce-headers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["authorization","fastify","fastify-plugin","headers","nodejs"],"created_at":"2024-12-15T12:15:58.610Z","updated_at":"2026-04-18T11:02:14.355Z","avatar_url":"https://github.com/osskit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"250\" height=\"250\" src=\"https://user-images.githubusercontent.com/15312980/175080445-1fb834d4-7321-424f-bfb0-0b3f4f81dc91.svg\" /\u003e\n\u003c/p\u003e\n\n# fastify-enforce-headers\nEnforce headers against http calls to your fastify API\n  \n\u003c/div\u003e\n\n## Install\n```\nyarn add @osskit/fastify-enforce-headers\n```\n\n## Usages\n\n### Simple\n```\nimport fastify from 'fastify';\nimport { enforceHeaders } from '@osskit/fastify-enforce-headers';\n\nawait fastify.register(enforceHeaders);\n```\n\n### Extra headers\n\n```\nimport fastify from 'fastify';\nimport { enforceHeaders, defaultHeaders } from '@osskit/fastify-enforce-headers';\n\nawait fastify.register(enforceHeaders, { headers: [...defaultHeaders, 'x-custom-header'] });\n```\n\n## API\n\n### enforceHeaders({headers})\n#### headers\nType: `string[]`\nDefault: `[]`\n\nThe headers you want to enforce on the request\n\nThrows a `400 - missing ${header}` error upon missing required header\n\n### defaultHeaders\n\nType: `string[]` by default `['x-api-client', 'x-api-client-version']`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosskit%2Ffastify-enforce-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosskit%2Ffastify-enforce-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosskit%2Ffastify-enforce-headers/lists"}