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

insightics-sdk

v1.0.1

Published

Prompt-driven, real-time analytics for a Node app, in one install. Each part is its own import path: insightics-sdk/server, insightics-sdk/react, insightics-sdk/core and the rest. There is deliberately no root import, so browser code cannot pull in server

Readme

insightics-sdk

Prompt-driven, real-time analytics for a Node application. Point it at your Postgres database, drop a component into your admin panel, and your users ask questions in plain language — "how many users joined this week, split by signup method" — and get a live chart back.

SQL derived from a prompt can only ever read. That is enforced by a parser-based allowlist, a GRANT SELECT-only role, and a read-only transaction that always rolls back — not by asking a model nicely.

1.0.1, and still unproven against a real database. Nothing in this project has run against a real Postgres or a real model yet; every test uses a recording fake. Run ik doctor against your own database before trusting it.

Install

npm install insightics-sdk pg @anthropic-ai/sdk

Use openai instead of @anthropic-ai/sdk if that is your provider. pg, the model SDKs and react are optional peers: install the ones you use.

One install, one import path per part

| Import | What it is | Runs in | |---|---|---| | insightics-sdk/server | the HTTP handler, with adapters for Next, Node/Express, Fastify and Hono | your server | | insightics-sdk/react | <Insight />, useAsk, useLiveResult and dependency-free SVG charts | the browser | | insightics-sdk/core | the read-only path, schema introspection, the planner, tenant scoping | your server | | insightics-sdk/core/pg | the node-postgres adapter | your server | | insightics-sdk/sql-guard | the security kernel: is this SQL a single, safe, read-only SELECT? | anywhere | | insightics-sdk/llm/anthropic, insightics-sdk/llm/openai | model provider adapters | your server | | insightics-sdk/llm, insightics-sdk/protocol | shared types and the browser–server contract | both |

It also installs the ik command: npx ik init, npx ik doctor, npx ik introspect.

There is no import … from 'insightics-sdk', on purpose. A root import would mix browser and server code, and one wrong import in a client component would ship your database URL and model key into the browser bundle. Inside the repository each path is a separate package with its own enforced boundaries; the build packs them into this one, and a test checks that the packed insightics-sdk/react reaches nothing on the server side.

Quick start

Server, mounted at app/api/insightics/[...route]/route.ts:

import { asReaderSource, introspectSchema } from 'insightics-sdk/core';
import { fromPgPool } from 'insightics-sdk/core/pg';
import { anthropicProvider } from 'insightics-sdk/llm/anthropic';
import { createInsightics, SINGLE_TENANT_ACKNOWLEDGEMENT, singleTenant, toNextRoute } from 'insightics-sdk/server';
import { createGuard } from 'insightics-sdk/sql-guard';
import { Pool } from 'pg';

const source = asReaderSource(
  fromPgPool(new Pool({ connectionString: process.env.DATABASE_URL, connectionTimeoutMillis: 5_000 })),
);

const ik = createInsightics({
  source,
  guard: await createGuard({ maxRows: 1000 }),
  provider: anthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-opus-5' }),
  schema: () => introspectSchema(source, { excludeSchemas: ['insightics'] }),
  tenancy: singleTenant(SINGLE_TENANT_ACKNOWLEDGEMENT),
  live: {},
});

export const { GET, POST } = toNextRoute(ik.handler);

Browser:

'use client';
import { Insight } from 'insightics-sdk/react';

export const Signups = () => (
  <Insight endpoint="/api/insightics" question="how many users signed up this week, by signup method" live />
);

tenancy is required and has no default. For multiple tenants, multiTenantFromJwt() verifies a bearer token and Postgres row-level security does the scoping.

Before it touches production

Create the read-only roles, then prove from the live catalog that the reader cannot write:

npx ik init --database app --owner app_owner > provision.sql   # review it, then run it as an admin
DATABASE_URL=postgres://admin@host:5432/app npx ik doctor

ik doctor exits non-zero when the proof fails, so it belongs in CI. With multiple tenants, run it with --strict, or a table without row-level security passes as a review finding.

Read more

How the read-only guarantee is built, how tenancy works, and exactly what has and has not been verified: github.com/Abhxhek/insightkit-sdk.

Apache-2.0.