{"repo":"kumpmati/sveltekit-superactions","free":true,"listed":false,"github":"https://github.com/kumpmati/sveltekit-superactions","clone":"git clone https://github.com/kumpmati/sveltekit-superactions.git","description":"Call your server code from the client like normal functions.","language":"TypeScript","stars":24,"topics":["server-actions","sveltekit","svelte","sveltejs","api"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"SvelteKit Superactions Call your server code from the client like normal functions. 🚧 This library is in an early state, and breaking changes will likely happen before the API is stabilised for a v1.0 release! 🚧 Documentation Why? While SvelteKit's data fetching patterns are great, but the ease-of-use of React Server Actions doesn't seem to have an equivalent in SvelteKit. The ability to just 'call a function' in the client-side, have it perform logic on the server and return the result to the client is sometimes very useful. SvelteKit's form actions are a great fit for many cases, but they can be clunky when you want to call an endpoint without a form element, or when you need to send data that is too complex to be represented in FormData. This library aims to provide additional tools alongside SvelteKit's API routes: Features - [x] Type satefy between server and client - [x] Automatic JSON conversion (request/response) - [x] Schema validation - [x] zod helper function - [x] joi helper function Installation Install Superactions with your favourite package manager: Usage A minimal setup requires the following. In a +server.ts file, define the actions that you want to use: And in any Svelte component import the superActions function and the exported types to instantiate the client.","default_branch":null,"files":null,"tree":[],"storefront":"/r/kumpmati","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kumpmati/sveltekit-superactions/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."}