@sudobility/svgr_client
v1.0.33
Published
API client SDK for SVGR with TanStack React Query hooks.
Downloads
1,070
Readme
@sudobility/svgr_client
API client SDK for SVGR with TanStack React Query hooks.
Installation
bun add @sudobility/svgr_clientUsage
import { SvgrClient, useConvert } from "@sudobility/svgr_client";
// Direct client usage
const client = new SvgrClient({ baseUrl: "https://api.svgr.app", networkClient });
const result = await client.convert(base64Image, "photo.png", 5, true);
// React hook usage
const { mutateAsync } = useConvert(client);
await mutateAsync({ original: base64Image, filename: "photo.png", quality: 5 });API
SvgrClient
Constructed with { baseUrl, networkClient, retry? }. Single endpoint: POST /api/v1/convert.
Hooks
useConvert(client)-- TanStack Query mutation for image-to-SVG conversionsvgrKeys-- Query key factory for cache management
Types
SvgrClientConfig,RetryConfig,ConvertMutationParams,SvgrApiError
Development
bun run build # Build ESM
bun test # Run tests
bun run verify # All checks + buildRelated Packages
svgr_types-- Shared type definitionssvgr_lib-- Shared business logicsvgr_api-- Backend API serversvgr_app-- Web appsvgr_app_rn-- React Native app
License
BUSL-1.1
