{"id":16967892,"url":"https://github.com/skyf0l/sveltekit-helmet","last_synced_at":"2025-04-11T23:41:40.972Z","repository":{"id":224229855,"uuid":"762673324","full_name":"skyf0l/sveltekit-helmet","owner":"skyf0l","description":"Important security headers for SvelteKit","archived":false,"fork":false,"pushed_at":"2025-04-09T21:03:12.000Z","size":849,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T22:19:58.057Z","etag":null,"topics":["csp","headers","helmet","hsts","http-headers","security","sveltekit"],"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/skyf0l.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-02-24T11:20:13.000Z","updated_at":"2025-04-09T21:03:14.000Z","dependencies_parsed_at":"2024-06-25T10:56:05.719Z","dependency_job_id":"9a2de4a1-3db2-4b96-bc57-68fb4f5f5366","html_url":"https://github.com/skyf0l/sveltekit-helmet","commit_stats":null,"previous_names":["skyf0l/sveltekit-helmet"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2Fsveltekit-helmet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2Fsveltekit-helmet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2Fsveltekit-helmet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2Fsveltekit-helmet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyf0l","download_url":"https://codeload.github.com/skyf0l/sveltekit-helmet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119984,"owners_count":21050867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csp","headers","helmet","hsts","http-headers","security","sveltekit"],"created_at":"2024-10-14T00:10:04.014Z","updated_at":"2025-04-11T23:41:40.936Z","avatar_url":"https://github.com/skyf0l.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sveltekit-helmet\n\n[![Version](https://img.shields.io/npm/v/sveltekit-helmet.svg)](https://www.npmjs.com/package/sveltekit-helmet)\n[![Helmet version](https://img.shields.io/badge/Helmet%20version-latest-g.svg)](https://github.com/helmetjs/helmet)\n[![Downloads](https://img.shields.io/npm/dm/sveltekit-helmet.svg)](https://www.npmjs.com/package/sveltekit-helmet)\n\nsveltekit-helmet is a wrapper for [helmet](https://github.com/helmetjs/helmet)\nto work with [SvelteKit](https://github.com/sveltejs/kit). It provides important\nsecurity headers to make your app more secure by default.\n\n## Installation\n\n```sh\nnpm i sveltekit-helmet\n\n# or:\n\nyarn add sveltekit-helmet\n```\n\n## Usage\n\nUsage is the same as helmet, see the\n[helmet documentation](https://helmetjs.github.io) for more information.\n\n\u003e [!WARNING]  \n\u003e Hot reload is blocked by default, you need to allow scriptSrc's\n\u003e `'unsafe-inline'` directive to use it.\n\nJust add the following to your `src/hooks.server.ts`:\n\n```ts\nimport helmet from \"sveltekit-helmet\";\n\n// With default helmet options\nexport const handle = helmet();\n\n// With custom helmet options\nexport const handle = helmet({\n  contentSecurityPolicy: {\n    directives: {\n      scriptSrc: [\n        \"'self'\",\n        \"'unsafe-inline'\", // Allow SvelteKit hot reload\n      ],\n    },\n  },\n});\n\n// Works with other middlewares\nimport { sequence } from \"@sveltejs/kit/hooks\";\nexport const handle = sequence(helmet(), fooMiddleware, barMiddleware);\n```\n\nCurrently, only the full helmet middleware is supported, you can just disable\nunwanted rules in options instead of using the individual middleware.\n\n## Versioning\n\nsveltekit-helmet currently only supports SvleteKit v2.\n\nIf you are using SvelteKit v1, you can open an issue and I will consider adding\nsupport for it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyf0l%2Fsveltekit-helmet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyf0l%2Fsveltekit-helmet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyf0l%2Fsveltekit-helmet/lists"}