Skip to content

Overview ​

@saflib/sdk is the platform library for TanStack Query clients, MSW fakes, and shared Vue components tied to an OpenAPI contract. SPAs import the SDK for making calls to the service backend.

Layout and naming for service packages are in monorepo — service/. The golden product SDK is base/service/sdk.

Use sdk/add-query and sdk/add-mutation to create TanStack functions, and sdk/add-component for standalone components.

What this package provides ​

ExportRole
createSafClient / handleClientMethodTyped openapi-fetch client with CSRF, subdomain routing, and TanStack error typing
createTanstackQueryClientDefault QueryClient (stale time, selective retries) for SPAs
useDownloadCookie-authenticated file downloads
createCredentialsEventSourceCookie-authenticated SSE (cross-subdomain)
./testingwithVueQuery, typedCreateHandler
./testing/mockVitest + MSW setupMockServer helper
./componentsCross-product shared components (e.g. AddressForm)
./workflowsScaffold and extend product SDK packages

See also Requests, Testing, and Fakes.