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

@viglet/shio-client

v2026.2.1

Published

Framework-agnostic TypeScript client for the Shio CMS Content Delivery API (CDA). Zero runtime dependencies — works in Node, the browser, edge runtimes, Next.js server components, Astro, Vue, Svelte and plain scripts.

Readme

@viglet/shio-client

Framework-agnostic TypeScript client for the Shio CMS Content Delivery API (CDA).

  • Zero runtime dependencies — just fetch.
  • Runs in Node, the browser, edge runtimes, Next.js server components, Astro, Vue, Svelte and plain scripts.
  • Targets the stable, read-only CDA contract (/api/v2/cda/**) — no Java, no legacy console API.
  • This is the base SDK; @viglet/shio-react-sdk is one consumer of it.

Install

npm install @viglet/shio-client

Quick start

import { ShioClient } from "@viglet/shio-client";

const shio = new ShioClient({
  baseUrl: "https://cms.example.com",
  apiToken: process.env.SHIO_CDA_TOKEN, // sent as the `Key` header
});

const sites = await shio.getSites();
const post = await shio.getPostByUrl(sites[0].id, "/blog/hello-world");
console.log(post?.attrs.title);

API

| Method | CDA endpoint | Returns | |---|---|---| | getSites() | GET /site | ShioSite[] | | getSite(siteId) | GET /site/{id} | ShioSite \| null | | listChildren(folderId, {page,size}) | GET /object/{id}/list | ShioListing \| null | | getPath(objectId) | GET /object/{id}/path | ShioPath \| null | | getPost(postId) | GET /post/{id} | ShioPost \| null | | getPostByUrl(siteId, url) | GET /post/by-url | ShioPost \| null | | query({siteId,folderId,postType,page,size}) | GET /query | ShioListing |

  • Single-resource getters return null on 404.
  • Any other non-OK status throws ShioHttpError ({ status, url, body }).
  • Every method accepts a final { signal } option for cancellation.

Next.js App Router — catch-all page

The getPostByUrl call is built for [...slug] routing:

// app/[...slug]/page.tsx
import { ShioClient } from "@viglet/shio-client";

const shio = new ShioClient({
  baseUrl: process.env.SHIO_URL!,
  apiToken: process.env.SHIO_CDA_TOKEN,
});

export default async function Page({ params }: { params: { slug?: string[] } }) {
  const url = "/" + (params.slug?.join("/") ?? "");
  const post = await shio.getPostByUrl(process.env.SHIO_SITE_ID!, url);
  if (!post) return <div>Not found</div>;
  return <article dangerouslySetInnerHTML={{ __html: String(post.attrs.content ?? "") }} />;
}

Custom runtimes / testing

Inject a fetch implementation for environments without a global fetch, or to stub it in tests:

const shio = new ShioClient({ baseUrl, fetch: myFetch });

Configuration

interface ShioClientConfig {
  baseUrl: string;              // required
  apiToken?: string;            // sent as `Key` header
  fetch?: typeof fetch;         // defaults to global fetch
  headers?: Record<string, string>;
  credentials?: RequestCredentials; // omitted by default (CDA uses token auth)
}

Develop

npm install
npm run build      # vite lib build + .d.ts
npm run typecheck  # tsc --noEmit
npm test           # node:test, no network (injected fetch)

License

GPL-3.0