Menu
Libraries |
Category

apity

A typed fetch client for openapi-typescript compatible with SvelteKit's custom fetch

Features

  • Support for JSON requests/responses from OpenAPI 3.0
  • Compatible with Svelte's {#await} syntax
  • Works with SvelteKit's fetch in load functions
  • Request reloading capability
  • Configurable default fetch options
  • Planned caching feature for identical requests

Target Audience

Primarily designed for Svelte and SvelteKit developers who need a typed API client that integrates well with Svelte's reactive patterns and SvelteKit's features.

Key Functionality

  • Generates typed API functions from OpenAPI specs
  • Provides Svelte stores for responses and request states
  • Supports both client-side and server-side usage in SvelteKit
  • Includes error handling for network issues
  • Works with Svelte's reactive patterns through stores

Usage Highlights

  • Uses openapi-typescript to generate TypeScript definitions
  • Creates request objects with:
    • Response stores (resp)
    • Promise stores (ready)
    • Reload functionality
    • Direct promise access (result)
  • Supports Svelte's await syntax in templates
  • Compatible with SvelteKit load functions

Live demo available with code samples.

apifetchopenapiopenapi3sveltesveltekittstypescript

Comments