npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sveltesentio/api

v0.6.2

Published

Typed openapi-fetch client wired with core's RFC 9457 problemMiddleware + an openapi-typescript codegen recipe

Readme

@sveltesentio/api

Typed openapi-fetch client wired with core's RFC 9457 problemMiddleware

Part of the sveltesentio composable SvelteKit framework.

Status

✅ v0.1.0 — createClient (openapi-fetch + problemMiddleware) and the openapi-typescript codegen recipe. Pairs with @sveltesentio/query.

Install

pnpm add @sveltesentio/api openapi-fetch
pnpm add -D openapi-typescript

Sub-exports

| Import | What | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | @sveltesentio/api | createClient, generateTypes, runCodegen, parseCodegenArgs, GENERATED_BANNER + types | | @sveltesentio/api/client | createClient alone | | @sveltesentio/api/codegen | generateTypes, runCodegen, parseCodegenArgs — the openapi-typescript wrapper, separated so a runtime bundle never pulls the generator | | @sveltesentio/api/auth-middleware | authMiddleware, TokenStore — attaches a bearer token per request and, on a 401, refreshes once and retries. The store and refresh function are injected, so it composes with any session strategy; a failed refresh surfaces as a ProblemError |

1. Generate types from your OpenAPI spec

@sveltesentio/api does not bundle a spec — point openapi-typescript at yours (any OpenAPI 3.x producer; e.g. a Go ogen-emitted openapi.yaml).

Option A: Run the openapi-typescript CLI directly

pnpm exec openapi-typescript ./api/openapi/openapi.yaml -o ./src/lib/api/types.ts

Option B: Call runCodegen from a project script

import { writeFile } from 'node:fs/promises';
import openapiTS, { astToString } from 'openapi-typescript';
import { runCodegen, type CodegenCliDeps } from '@sveltesentio/api/codegen';

const deps: CodegenCliDeps = {
  openapiTS: (source, options) => openapiTS(source, options),
  astToString: (ast) => astToString(ast as Parameters<typeof astToString>[0]),
  writeFile: (path, contents) => writeFile(path, contents, 'utf8'),
  log: (msg) => console.error(msg),
};

await runCodegen(deps, process.argv.slice(2));

2. Create a client

import { createClient } from '@sveltesentio/api';
import type { paths } from './lib/api/types.js';
import { PUBLIC_API_BASE_URL } from '$env/static/public';

export const api = createClient<paths>({ baseUrl: PUBLIC_API_BASE_URL });

// In a load() — forward SvelteKit's fetch for SSR cookie/dedup support:
const { data } = await api.GET('/items/{id}', { params: { path: { id } }, fetch });

On any application/problem+json non-2xx response the call throws core's ProblemError (RFC 9457), so @sveltesentio/query's retry/optimistic helpers and @sveltesentio/forms' problemToFieldErrors get a typed error. Pass problem: false to disable, or middlewares: [...] to add your own (auth, tracing).

License

EUPL-1.2 © lusoris. Releases up to and including 0.3.0 are MIT.