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

@smoothcdn/api-accelerator-sdk

v1.0.4

Published

SDK for consuming Smooth API Accelerator JSON outputs from Smooth CDN.

Readme

@smoothcdn/api-accelerator-sdk

TypeScript SDK for consuming JSON outputs generated by the Smooth API Accelerator plugin and hosted on Smooth CDN.

Scope

  • core - API client with token support
  • framework adapters: next, nuxt, astro, sveltekit, remix
  • adapters include framework-oriented helpers for caching, revalidation, runtime fetch, and loader integration

Installation

npm install @smoothcdn/api-accelerator-sdk

Core

import { createApiClient } from "@smoothcdn/api-accelerator-sdk";

const client = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project",
  token: process.env.SMOOTHCDN_TOKEN
});

const posts = await client.fetch("/wp/v2/posts", {
  fields: ["id", "title"]
});

Query API

  • fields -> appends _fields=... (for example _fields=id,title)
  • dot notation is not supported: title.rendered is normalized to title
  • page -> fetches paginated JSON from /page-N.json
  • fetchAll() -> fetches collection metadata first and then combines every page into one array
  • join -> replaces selected fields with extra fetches based on route templates
  • where -> appends filters as query params
  • when page is omitted, fetch() prefers /page-1.json if /list contains that route
  • /list is resolved lazily when fetch() or fetchAll() runs, not during createApiClient()
import { createApiClient } from "@smoothcdn/api-accelerator-sdk";

const client = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project",
  token: process.env.SMOOTHCDN_TOKEN
});

const post = await client.fetch("/wp/v2/posts", {
  page: 1,
  fields: ["id", "title"],
  where: { id: 123 }
});

For example:

client.fetch("/wp/v2/posts", { page: 1 })

fetches:

https://cdn.smoothcdn.com/<user-slug>/<project-slug>/wp/v2/posts/page-1.json

const allPosts = await client.fetchAll("/wp/v2/posts", {
  fields: ["id", "title"]
});
const posts = await client.fetch("/wp/v2/posts", {
  join: {
    author: "/wp/v2/users/[author]"
  }
});

join works for both a single object and arrays. For every item, the placeholder value is taken from the current result item and the fetched response replaces that field.

Next.js

import { createApiClient } from "@smoothcdn/api-accelerator-sdk/next";

const next = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project",
  token: process.env.SMOOTHCDN_TOKEN
});

export async function getStaticProps() {
  return next.createStaticProps("/wp/v2/pages", { revalidate: 60 });
}

export async function getFeaturedPost() {
  return next.getRouteData("/wp/v2/posts", {
    fields: ["id", "title"],
    where: { id: 123 },
    cache: "force-cache",
    next: {
      revalidate: 300,
      tags: ["posts", "featured-post"]
    }
  });
}

createStaticProps() uses fetchAll() for paginated collections.

Nuxt

import { createApiClient } from "@smoothcdn/api-accelerator-sdk/nuxt";

const nuxt = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project",
  token: process.env.SMOOTHCDN_TOKEN
});

export default defineComponent({
  setup() {
    const requestFetch = useRequestFetch();
    return nuxt.useRouteDataWithAutoKey(useAsyncData, "/wp/v2/posts", {
      fetch: requestFetch,
      asyncData: {
        dedupe: "defer",
        lazy: true
      }
    });
  }
});

useRouteData() and useRouteDataWithAutoKey() use fetchAll() for paginated collections.

Astro

import { createApiClient } from "@smoothcdn/api-accelerator-sdk/astro";

const astro = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project"
});

const loadPosts = astro.createLoader("/wp/v2/posts", {
  fields: ["id", "title"]
});

const posts = await loadPosts({ fetch });

createLoader() uses fetchAll() for paginated collections.

SvelteKit

import { createApiClient } from "@smoothcdn/api-accelerator-sdk/sveltekit";

const sveltekit = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project"
});

export const load = sveltekit.createLoad("/wp/v2/posts", {
  fields: ["id", "title"],
  depends: ["smooth:posts"],
  cacheControl: "public, max-age=60"
});

createLoad() uses fetchAll() for paginated collections.

Remix

import { json } from "@remix-run/node";
import { createApiClient } from "@smoothcdn/api-accelerator-sdk/remix";

const remix = createApiClient({
  userSlug: "example-user",
  projectSlug: "my-project",
  token: process.env.SMOOTHCDN_TOKEN
});

export const loader = remix.createJsonLoader(json, "/wp/v2/posts", {
  fields: ["id", "title"],
  where: { id: 123 },
  useRequestSignal: true
});

createLoader() and createJsonLoader() use fetchAll() for paginated collections.