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

@brandfine/client

v0.8.0

Published

Brandfine consumer SDK — typed HTTP client, server-side caches, locale + navigation resolvers, and webhook helpers for landing-page integrations.

Readme

@brandfine/client

Typed HTTP client, server-side caches, locale + navigation resolvers, webhook helpers, and analytics tracker installer for landing pages consuming the Brandfine CMS.

Status: early development (0.x.y). API may change in minor bumps before 1.0.

Install

npm install @brandfine/client

Available on public npm with provenance — installs are verified against this repo's CI runs.

Subpath exports

import {
  createBrandfineClient,
  type AnalyticsConfig,
  type AnalyticsInstallResult,
} from '@brandfine/client'
import { createCache, createKeyedCache } from '@brandfine/client/cache'
import { resolveNavigation, localizePath } from '@brandfine/client/resolvers'
import {
  verifyWebhookSecret,
  parseWebhookPayload,
} from '@brandfine/client/webhook'

Pick the import path that scopes to what you actually use — tree-shaking does the rest, but subpath imports keep consumer bundle analysis honest.

What it does

const bf = createBrandfineClient({
  baseUrl: 'https://api.brandfine.co',
  apiKey: process.env.BRANDFINE_API_KEY!,
})

// Content reads
await bf.posts.list({ type: 'blog', locale: 'pt' })
await bf.posts.getBySlug('uk-eta-2026')
await bf.workspace.get()
await bf.categories.list()
await bf.navigations.get('header')

// Analytics — auto-inject the Brandfine tracker into <head>
await bf.analytics.install()

// Submissions — POST a contact-form submission
await bf.submissions.create({
  name: 'Alex',
  email: '[email protected]',
  message: 'Hello!',
})

// Appointments — for workspaces running the Appointments plugin
const { slots } = await bf.appointments.getAvailability()
await bf.appointments.createRequest({
  visitorName: 'Alex',
  visitorEmail: '[email protected]',
  requestedAt: slots[0].start,
})

The full surface lives under seven namespaces — posts, categories, workspace, navigations, analytics, submissions, appointments — plus a get(path) escape hatch.

Server-side only

The workspace API key (bfwk_*) is broad-scope — it can read posts, navigations, submissions, analytics, and write submissions + appointments. Don't put it in the browser bundle even behind a NEXT_PUBLIC_* / PUBLIC_* / VITE_* prefix.

Every recipe in our docs (SDK reference) keeps the SDK call server-side. Your frontend posts to your own backend; your backend hits Brandfine.

Static-export site without a server runtime? See Static sites for your options — add an adapter, run a tiny proxy, or wait for scoped publishable keys (bfpk_*, on the roadmap).

Analytics

bf.analytics.install() fetches this workspace's tracker config from Brandfine and injects <script defer src="…" data-website-id="…"> into document.head exactly once. Idempotent across StrictMode double-invokes, SPA route changes, and multi-instance scenarios via a marker attribute on the injected tag.

For static sites (Next.js output: 'export', Astro), use the build-time variant to keep the API key out of the browser bundle and skip the runtime round-trip:

// Server-side at build/request time:
const config = await bf.analytics.getConfig()
// Pass `config` to a client component that calls:
bf.analytics.install({ config })

Full walkthrough with framework recipes: docs.brandfine.co/docs/sdk/analytics.

Caching

createCache(opts) and createKeyedCache(opts) are minimal SWR caches with TTL + background revalidation. They take any async fetcher — including bf.posts.list — and make the cached value the source of truth for hot paths. Pair with verifyWebhookSecret to invalidate on publish.

Documentation

License

MIT