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

@accountgroove/blog

v0.1.0

Published

Client SDK for the AccountGroove Content API — render a tenant's published blog on their own Astro/Next site.

Readme

@accountgroove/blog

Client SDK for the AccountGroove Content API. Drop it into a client's Astro or Next.js site to render their published blog on their own domain, with their own CSS — subdirectory URLs (client.com/blog), great SEO, no iframe.

This is the "Bucket A" delivery adapter from the platform architecture (docs/PLATFORM-ARCHITECTURE.md §7): for sites we build/control, the blog is rendered inside the site's own app, so styling matches automatically.

Install

npm install @accountgroove/blog

Set two env vars in the host site:

ACCOUNTGROOVE_API_BASE=https://mcp.accountgroove.ai   # Content API base (default)
ACCOUNTGROOVE_LOCATION_ID=<the client's GHL locationId>

Core usage (any framework)

import { createBlogClient } from "@accountgroove/blog";

const blog = createBlogClient({
  apiBase: process.env.ACCOUNTGROOVE_API_BASE!,
  locationId: process.env.ACCOUNTGROOVE_LOCATION_ID!,
});

const posts = await blog.listPosts({ type: "blog", limit: 20 }); // BlogPostSummary[]
const post = await blog.getPost("my-slug");                       // BlogPost | null

Only published posts (status='posted') are ever returned, scoped to the location. listPosts gives an excerpt; getPost gives the full body.

Astro (primary)

Copy the example routes:

  • examples/astro/blog-index.astro → src/pages/blog/index.astro
  • examples/astro/blog-slug.astro → src/pages/blog/[slug].astro

They use export const prerender = false (Astro hybrid/SSR) so newly published posts appear immediately. Wrap them in your site layout so the blog inherits the nav/footer/CSS.

Next.js (App Router)

Copy:

  • examples/next/blog-page.tsx → app/blog/page.tsx
  • examples/next/blog-slug-page.tsx → app/blog/[slug]/page.tsx
  • examples/next/revalidate-route.ts → app/api/accountgroove/revalidate/route.ts

The pages tag their fetches (ag-blog, ag-blog:<slug>) and the revalidate route purges those tags on publish — ISR + on-demand revalidation, no redeploy (docs §11). Set ACCOUNTGROOVE_REVALIDATE_SECRET and register the route URL as the site's publish webhook in AccountGroove.

Freshness model

| Mode | How fresh content arrives | | --- | --- | | Next (App Router) | publish → webhook → revalidateTag → live in seconds | | Astro (SSR/hybrid) | rendered per request → always current (add a CDN cache + purge for speed) | | Static build | rebuild/redeploy on publish (simplest, slowest) |

API

  • createBlogClient(options): BlogClient
    • options.apiBase — Content API base URL
    • options.locationId — the tenant's GHL locationId
    • options.fetch? — fetch override
  • client.listPosts(params?, init?) → Promise<BlogPostSummary[]>
    • params: { type?, limit?, offset? } · init: standard RequestInit (e.g. { next: { tags: ["ag-blog"], revalidate: 60 } })
  • client.getPost(slug, init?) → Promise<BlogPost | null> (null on 404)
  • Throws BlogApiError (.status, .url) on other non-OK responses.