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

@nsp-labs/agnostic-sdk

v1.0.4

Published

Server-side Runtime SDK for Agnostic project services, workers, automations, and trusted local scripts.

Readme

@nsp-labs/agnostic-sdk

TypeScript Runtime SDK for server-side code running inside an Agnostic project runtime or trusted local scripts. It is scoped to one projectId + environment + runtime token and does not expose control-plane resources.

npm install @nsp-labs/agnostic-sdk

Context

Inside managed runtime, context is resolved automatically:

AGNOSTIC_API_URL=
AGNOSTIC_PROJECT_ID=
AGNOSTIC_ENVIRONMENT=
AGNOSTIC_RUNTIME_TOKEN=

Local scripts can pass the same context explicitly:

import { createAgnosticRuntime } from '@nsp-labs/agnostic-sdk';

const agnostic = createAgnosticRuntime({
  apiUrl: 'https://api.agn0.ru',
  projectId: 'proj_123',
  environment: 'production',
  token: process.env.AGNOSTIC_RUNTIME_TOKEN,
});

Runtime tokens are server-side credentials. Do not put AGNOSTIC_RUNTIME_TOKEN in browser, mobile, Vite, or static frontend bundles.

The current public runtime surface includes auth, context, data, workflows, and workflowRuns.

App Auth

Use agnostic.auth.requireSession(request) in an application backend to verify the incoming App Auth session through the runtime helper:

const session = await agnostic.auth.requireSession(request);

await agnostic.data.table('orders').records.update(
  'order_123',
  { values: { status: 'fulfilled' } },
  { actor: session.actor },
);

The helper extracts Authorization: Bearer <app-session> or an agnostic_app_session_* cookie, then calls /api/v1/runtime/app-auth/session/verify with the server-side runtime token. It returns sanitized user/session claims and an app_user actor for audit metadata. agnostic.auth.getUser(userId) reads sanitized App Auth user claims for the same runtime project.

Data

const orders = await agnostic.data.table('orders').records.list({
  filter: { status: 'paid' },
  limit: 50,
});

const created = await agnostic.data.table('orders').records.create({
  values: {
    customerId: 'cust_123',
    status: 'paid',
  },
});

await agnostic.data.table('orders').records.update(created.id, {
  status: 'fulfilled',
});

await agnostic.data.table('orders').records.delete(created.id);

Workflows

const run = await agnostic.workflows.start('send-receipt', {
  orderId: 'order_123',
});

const finished = await agnostic.workflowRuns.wait(run.id, {
  timeoutMs: 30_000,
});

Actor Metadata

After an application backend has verified its App Auth session and business guardrails, it can pass actor metadata for audit context:

await agnostic.workflows.start(
  'send-receipt',
  { orderId: 'order_123' },
  {
    actor: {
      type: 'app_user',
      id: 'app_user_123',
      scopes: ['orders:write'],
    },
  },
);

Allowed actor types are app_user, platform_user, runtime, and system. Actor metadata is not authorization input for Runtime SDK capabilities.

Errors

Runtime API failures throw AgnosticRuntimeError:

import { AgnosticRuntimeError } from '@nsp-labs/agnostic-sdk';

try {
  await agnostic.data.table('orders').records.list();
} catch (error) {
  if (error instanceof AgnosticRuntimeError) {
    console.error(error.status, error.code, error.message, error.details);
  }
}

OpenAPI Layer

src/generated/openapi.ts is generated from /api/docs-json after filtering to /api/v1/runtime/* paths:

npm run sdk:gen

CI validates the committed generated layer with:

npm run sdk:check

The generated client is internal. Public code should use createAgnosticRuntime and the ergonomic namespaces above.

Versioning And Changelog

@nsp-labs/agnostic-sdk follows semver with the Runtime SDK API contract. Breaking runtime endpoint or public SDK changes require a major version; backwards-compatible namespaces, methods, options, or response fields are minor changes; bug fixes and generated type refreshes without API changes are patch changes.

Release notes are tracked in CHANGELOG.md. Do not publish a package version unless the changelog is updated and npm run sdk:check passes.