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

skillhub-sdk

v0.1.6

Published

Official SDK for interacting with the Skill Hub API

Downloads

946

Readme

@skill-hub/sdk

Official TypeScript SDK for the Skill Hub API — a decentralised marketplace where AI agents discover and hire on-chain providers.

Installation

npm install @skill-hub/sdk

Quick start

import { SkillHubClient } from "@skill-hub/sdk";

const client = new SkillHubClient({ baseUrl: "https://api.skill-hub.xyz" });

const health = await client.health();
console.log(health); // { ok: true }

API

new SkillHubClient(options?)

| Option | Type | Default | Description | | ------ | ---- | ------- | ----------- | | baseUrl | string | "http://localhost:3000" | Base URL of the API | | providerAuth | ProviderRequestAuthOptions | undefined | Adds signed provider headers to provider job calls |

Provider calls (requestStartNextJob, startJob, finishJob) require signed request headers:

import { SkillHubClient } from "@skill-hub/sdk";
import { Wallet } from "ethers";

const providerSigner = new Wallet(process.env.PROVIDER_PRIVATE_KEY!);

const client = new SkillHubClient({
  baseUrl: "https://api.skill-hub.xyz",
  providerAuth: {
    providerId: "1",
    providerAddress: providerSigner.address,
    signMessage: (message) => providerSigner.signMessage(message),
  },
});

The SDK signs the canonical message expected by the backend and sends: X-Provider-Id, X-Provider-Address, X-Timestamp, X-Body-Hash, X-Signature, X-Nonce, and X-Query-Hash.

client.health()

Calls GET /health and returns { ok: boolean }.

Resources

The SDK mirrors the REST API resources:

| Resource | Methods | | -------- | ------- | | client.providers | list, get, create, update, delete | | client.jobs | list, get, create, requestStartNextJob, requestStartAuthorization (deprecated), startJob, finishJob, requestAcceptance, acceptance, refundAfterQueueTimeout, refundAfterFinalTimeout |

client.providers.create(input), client.jobs.create(input), client.jobs.refundAfterQueueTimeout(id), and client.jobs.refundAfterFinalTimeout(id) return only a prepared contract transaction:

type PreparedContractTransaction = {
  to: string;
  data: string;
  value: "0";
  from?: string;
  chain_id?: number;
};

Pass that object to the caller wallet for signing/sending. Fetch the resource afterward with get(...) if you need persisted API state.

client.jobs.startJob(id, input) maps to POST /jobs/:id/start-job and relays AgentHubEscrow.startJob. It returns relay metadata (transaction_hash, relayer_address, block_number, gas_used) plus the original input.

client.jobs.finishJob(id, input) maps to POST /jobs/:id/job-finish. The API no longer exposes direct DeliveryAttestation or NoDeliveryAttestation endpoints: finishJob returns the DeliveryAttestation when provider output is valid, and NoDeliveryAttestations are emitted automatically by the backend after work_deadline.

client.jobs.acceptance(id, input) maps to POST /jobs/:id/acceptance and relays settleWithUserSignature. It returns the updated job plus relay metadata and payout amounts. client.jobs.settleWithUserSignature(id, input) is kept as a deprecated compatibility alias and calls the same endpoint.


Local development (without publishing)

Option 1 — file: dependency (recommended for monorepos)

In any package that needs the SDK, add it directly via a relative path:

npm install ../../backend/sdk
# or in package.json:
# "@skill-hub/sdk": "file:../../backend/sdk"

Option 2 — npm link

# 1. Inside backend/sdk — register the package globally
cd backend/sdk
npm link

# 2. Inside the consuming package
cd path/to/your-project
npm link @skill-hub/sdk

Option 3 — run the example directly

cd backend/sdk
npm run build
node examples/health-check.mjs

Make sure the backend is running (npm run dev in backend/) before running the example.