A modular rate limiter for SvelteKit. Use in password resets, account registration, etc.
SvelteKit Rate Limiter is a modular rate limiter designed for password resets, account registration, and similar functionalities. It can be easily integrated into your SvelteKit project by using the provided modules in your page.server.ts files or hooks.server.ts. The rate limiter utilizes an in-memory cache using @isaacs/ttlcache, but can also be swapped out for alternative caching solutions. The source file includes interfaces for both the cache and limiters, allowing for easy customization.
page.server.ts files or hooks.server.ts@isaacs/ttlcacheTo install SvelteKit Rate Limiter, follow these steps:
npm install sveltekit-rate-limiter
import { RateLimiter, RateLimiterStore, RetryAfterRateLimiter } from 'sveltekit-rate-limiter';
SvelteKit Rate Limiter is a versatile tool for implementing rate limiting functionality in SvelteKit projects. With its modular design and support for customizable limiters, it provides developers with the flexibility and control they need to protect sensitive actions such as password resets and account registration. By utilizing an in-memory cache and providing interfaces for cache and limiters, SvelteKit Rate Limiter allows for easy integration and customization.