Overview:
The SvelteKit TypeSafe API Fetch is a package that aims to make fetching and validating server endpoints easier in SvelteKit. It provides type-safe fetch-like functions and utilizes the powerful zod library for parsing incoming data. The package is easy to install and offers a plug and play, opt-in structure.
Features:
- Type safe fetch-like functions: Provides type-safe fetch-like functions that improve the coding experience.
- Usage of the zod library: Utilizes the zod library for parsing and validating incoming data.
- Plug and play and opt-in structure: Offers a plug and play, opt-in structure that allows for easy integration into existing projects.
Installation:
To install the SvelteKit TypeSafe API Fetch package, follow these steps:
- Install the package using your favorite NodeJS package manager.
- Add the vite plugin to your project.
- Create a zod object to validate the request body of your endpoint and pass it to the validate function.
Summary:
The SvelteKit TypeSafe API Fetch package simplifies the process of fetching and validating server endpoints in SvelteKit. It provides type-safe fetch-like functions and utilizes the zod library for parsing and validating incoming data. The package is easy to install and offers a plug and play, opt-in structure. Although it is still in beta, feedback, bug reports, and contributions are welcome.