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

skillbroker

v0.1.0

Published

JavaScript/TypeScript SDK for SkillBroker - Access expert knowledge in your AI applications

Downloads

12

Readme

SkillBroker JavaScript/TypeScript SDK

Access expert knowledge in your applications with SkillBroker - the marketplace where AI agents pay for human expertise.

Installation

npm install skillbroker
# or
yarn add skillbroker
# or
pnpm add skillbroker

Quick Start

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

// Search for skills
const results = await client.search({ query: 'tax advice' });
console.log(`Found ${results.skills.length} skills`);

// Invoke a skill
const response = await client.invoke(
  'freelancer-tax-advisor',
  'Can I deduct my home office as a freelancer?'
);
console.log(response.response);

Configuration

Environment Variables

# Optional: Override the API URL (defaults to https://api.skillbroker.io)
export SKILLBROKER_API_URL="https://api.skillbroker.io"

# Optional: API key for authenticated requests
export SKILLBROKER_API_KEY="your-api-key"

Programmatic Configuration

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient({
  apiUrl: 'https://api.skillbroker.io',
  apiKey: 'your-api-key',
  timeout: 30000, // 30 seconds
});

API Reference

SkillBrokerClient

const client = new SkillBrokerClient(config?: SkillBrokerConfig);

// Methods
await client.getRegistryInfo(): Promise<RegistryInfo>
await client.search(options?: SearchOptions): Promise<SearchResult>
await client.getSkill(skillId: string): Promise<Skill>
await client.invoke(skillId: string, query: string, context?: object): Promise<SkillResponse>
await client.getCategories(): Promise<Category[]>
await client.getTopSkills(options?: { limit?: number; category?: string }): Promise<Skill[]>
await client.getRecommendations(taskDescription: string, limit?: number): Promise<Skill[]>

Types

interface Skill {
  id: string;
  name: string;
  description: string;
  category: string;
  version: string;
  author: string;
  tags?: string[];
  pricing?: SkillPricing;
  stats?: SkillStats;
  quality?: SkillQuality;
}

interface SkillResponse {
  success: boolean;
  response: string;
  skillId: string;
  skillName: string;
  tokensUsed?: number;
  cost?: number;
}

interface SearchResult {
  skills: Skill[];
  totalCount: number;
  query?: string;
  category?: string;
}

Examples

Search for Skills

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

// Search by query
const results = await client.search({ query: 'financial planning' });

// Search by category
const financeSkills = await client.search({
  category: 'Finance',
  limit: 10
});

// Display results
for (const skill of results.skills) {
  console.log(`${skill.name}: ${skill.description}`);
}

Invoke a Skill

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

try {
  const response = await client.invoke(
    'freelancer-tax-advisor',
    'What expenses can I deduct as a freelance developer?',
    { userType: 'freelancer', country: 'US' } // Optional context
  );

  console.log(response.response);
  console.log(`Tokens used: ${response.tokensUsed}`);
} catch (error) {
  console.error('Failed to invoke skill:', error.message);
}

Get Recommendations

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

// Get skill recommendations for a task
const recommendations = await client.getRecommendations(
  'I need help understanding cryptocurrency tax implications',
  3
);

for (const skill of recommendations) {
  console.log(`Recommended: ${skill.name}`);
}

Get Top Skills

import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

// Get top-rated skills
const topSkills = await client.getTopSkills({ limit: 5 });

// Get top skills in a category
const topFinanceSkills = await client.getTopSkills({
  limit: 5,
  category: 'Finance'
});

Error Handling

import {
  SkillBrokerClient,
  SkillBrokerError,
  SkillNotFoundError,
  InvocationError
} from 'skillbroker';

const client = new SkillBrokerClient();

try {
  const response = await client.invoke('unknown-skill', 'question');
} catch (error) {
  if (error instanceof SkillNotFoundError) {
    console.error('Skill not found');
  } else if (error instanceof InvocationError) {
    console.error('Failed to invoke skill');
  } else if (error instanceof SkillBrokerError) {
    console.error('API error:', error.message);
  }
}

Framework Integration

Express.js

import express from 'express';
import { SkillBrokerClient } from 'skillbroker';

const app = express();
const client = new SkillBrokerClient();

app.post('/ask-expert', async (req, res) => {
  const { skillId, question } = req.body;

  try {
    const response = await client.invoke(skillId, question);
    res.json({ answer: response.response });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

Next.js API Route

// pages/api/skills/invoke.ts
import type { NextApiRequest, NextApiResponse } from 'next';
import { SkillBrokerClient } from 'skillbroker';

const client = new SkillBrokerClient();

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse
) {
  const { skillId, query } = req.body;

  const response = await client.invoke(skillId, query);
  res.json(response);
}

Support

  • Documentation: https://skillbroker.io/docs
  • API Reference: https://api.skillbroker.io/swagger
  • Issues: https://github.com/skillbroker/skillbroker-js/issues
  • Email: [email protected]

License

MIT License - see LICENSE file for details.