{"repo":"CaptainCodeman/svelte-kit-bot-block","free":true,"listed":false,"github":"https://github.com/CaptainCodeman/svelte-kit-bot-block","clone":"git clone https://github.com/CaptainCodeman/svelte-kit-bot-block.git","description":"Block annoying bot and script-kiddie requests to your SvelteKit app","language":"TypeScript","stars":37,"topics":["block","bot","http","svelte-kit"],"license":"MIT","category":"security-tools","readme_excerpt":"svelte-kit-bot-block Put any server on the internet and you should expect it to be hit with endless spam requests, usually a mix of rogue bots and script kiddies, probing for vulnerabilities. Instead of allowing these to be processed by your app, which may involve database lookups, it's better to reject them as soon as possible. Ideally, you'd do this at the network or load balancing layer, but if you're using SvelteKit and want a cheap-as-chips solution, you can add a Server Hook to handle them before your app has to. You don't even want your app rendering a nicely formatted error response - these are not legitimate requests, say goodbye to them using as few resources as possible. A simple HTTP response is all that they deserve. UPDATE: I've created a more flexible package that is significantly faster, called web-sentinel, which I recommend using instead. Usage Install using your package manager of choice: pnpm i svelte-kit-bot-block Import into your hooks.server.ts file: If you already have existing hooks you'll likely want to use the sequence helper to chain them. This hook should be at or close to the start of the chain. You can pass a configuration option object to createHandler . Any option you set will replace the default for that setting. - log (boolean) whether to log blocked (or would-be-blocked) requests - block (boolean) whether to actually block requests (vs just warn, to test the settings) - ip access (boolean) whether to block IP Address only requests (that don","default_branch":null,"files":null,"tree":[],"storefront":"/r/CaptainCodeman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/CaptainCodeman/svelte-kit-bot-block/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}