{"repo":"GrottoPress/kitty","free":true,"listed":false,"github":"https://github.com/GrottoPress/kitty","clone":"git clone https://github.com/GrottoPress/kitty.git","description":"Kitty is a collection of utilities for SvelteKit","language":"TypeScript","stars":16,"topics":["sveltekit","svelte","typescript","nodejs"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Kitty Kitty is a collection of utilities for SvelteKit . It includes libraries and handlers for developing secure frontend apps. Kitty features encrypted server-side sessions, and provides mitigations against CSRF attacks for forms submitted to the server. Installing 1. Install via PNPM: 1. Set compilerOptions.moduleResolution to bundler , node16 , or nodenext in tsconfig.json : This prevents the following error: See . Using Handlers Kitty provides the following handlers: - decryptSession : Decrypts session retrieved from the Cookie request header - disableCache : Sets Cache-Control and Expires headers to disable caching app-wide - encryptSession : Encrypts session and sends it via the Set-Cookie response header - filterRequestMethods : Forbids requests methods not listed in the ALLOWED REQUEST METHODS env var - verifyCsrfToken : Generates and verifies CSRF tokens for requests that require them The src/hooks.server.ts file should look similar to this: Add the following to the .env file: Update the file with your own details. Use a cryptographically-secure value for the secret key. You may run tr -cd '[:alnum:]' < /dev/random fold -w32 head -n1 to generate a key. Remember to set secure permissions for this file: chmod 0600 .env . Add types to src/app.d.ts : Disable SvelteKit's built-in CSRF protection in svelte.config.js : Session Kitty features encrypted server-side sessions. Any value stored in the event.locals.session object is encrypted and persisted as cookies on the clie","default_branch":null,"files":null,"tree":[],"storefront":"/r/GrottoPress","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/GrottoPress/kitty/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."}