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

@sstraatemans/sw_trpcclient

v0.7.0

Published

Shared tRPC types, Zod schemas, and client utilities

Readme

@sstraatemans/sw_trpcclient

Type-safe client library for accessing Suske en Wiske (Spike and Suzy) comic data

A fully type-safe tRPC client package that provides auto-generated hooks and utilities for querying Suske en Wiske albums, characters, artists, and collections. Built on top of @trpc/client with full TypeScript support and Zod schema validation.


Table of Contents


Installation

npm

npm install @sstraatemans/sw_trpcclient

yarn

yarn add @sstraatemans/sw_trpcclient

pnpm

pnpm add @sstraatemans/sw_trpcclient

Peer Dependencies

This package requires the following peer dependencies:

npm install superjson zod

Or with pnpm:

pnpm add superjson zod

Quick Start

Get started in just a few lines of code:

import { createClient } from '@sstraatemans/sw_trpcclient';

// 1. Create the client
const trpc = createClient({
  url: 'https://playground-trpcserver.vercel.app/trpc/v1',
});

// 2. Make type-safe queries
const albums = await trpc.albums.all.query({ offset: 0, limit: 10 });
console.log(`Found ${albums.totalCount} albums`);

// 3. Get a specific album by ID
const album = await trpc.albums.getAlbumById.query(1);
console.log(`Album: ${album.title}`);

Client Setup

Basic Usage

The simplest way to set up the client:

import { createClient } from '@sstraatemans/sw_trpcclient';

export const trpcClient = createClient({
  url: 'https://playground-trpcserver.vercel.app/trpc/v1',
});

With Custom Headers

Add authentication or custom headers:

import { createClient } from '@sstraatemans/sw_trpcclient';

export const trpcClient = createClient({
  url: 'https://playground-trpcserver.vercel.app/trpc/v1',
  headers: {
    'x-api-key': process.env.API_KEY,
    'x-client-version': '1.0.0',
  },
});

Or use a function for dynamic headers:

export const trpcClient = createClient({
  url: 'https://playground-trpcserver.vercel.app/trpc/v1',
  headers: async () => {
    const token = await getAuthToken();
    return {
      authorization: `Bearer ${token}`,
    };
  },
});

Configuration Options

interface CreateClientOptions {
  // Server URL (required)
  url: string;

  // Custom transformer (default: superjson)
  transformer?: typeof superjson;

  // HTTP headers for requests
  headers?:
    | Record<string, string>
    | (() => Record<string, string> | Promise<Record<string, string>>);

  // Maximum URL length for batching (default: 4000)
  maxURLLength?: number;

  // Maximum batch items (default: 3)
  maxItems?: number;
}

Example with all options:

import { createClient } from '@sstraatemans/sw_trpcclient';
import superjson from 'superjson';

export const trpcClient = createClient({
  url: 'https://playground-trpcserver.vercel.app/trpc/v1',
  transformer: superjson,
  headers: {
    'x-client-name': 'my-app',
  },
  maxURLLength: 5000,
  maxItems: 5,
});

Documentation


Alternative APIs

Don't want to use tRPC? No problem! The Suske en Wiske data is also available through other APIs:

GraphQL API

Access the data using GraphQL for flexible queries and precise data fetching.

query {
  albums(limit: 10) {
    id
    title
    year
  }
}

GraphQL Endpoint: https://graphql.suskeenwiske.dev/v1

REST API

Use traditional REST endpoints for simple HTTP requests.

curl https://suskeenwiske.dev/api/v1/albums

REST Base URL: https://suskeenwiske.dev/api/v1

For more information about the GraphQL and REST APIs, visit the online documentation.


Features

Fully Type-Safe - Auto-generated TypeScript types from the tRPC server
🔒 Zod Validation - Runtime type checking with Zod schemas
📦 Tree-Shakeable - Only import what you need
🚀 HTTP Batching - Automatic request batching for better performance
🎯 IntelliSense - Full autocomplete support in your IDE
🌐 SuperJSON - Native support for Date, Map, Set, BigInt, and more


License

This project is licensed under the ISC License - see the LICENSE file for details.


Disclaimer

The data exposed by this package is not owned by the package author or maintainer. All such data is freely available on the internet from public sources.

The copyright to Suske en Wiske and all related characters, stories, and intellectual property yada yada yada is owned by Standaard Uitgeverij. This package does not claim any ownership or endorsement rights.


Support

GitHub issues Open new issue

Having an issue, question, or want to contribute?

  1. Check existing issuesIssues page
  2. Not found? Open a new issue

Happy coding! 🎉