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

@fetch-hive/sdk

v0.3.0

Published

Official Node.js / TypeScript SDK for the Fetch Hive API

Readme

@fetch-hive/sdk

Official Node.js / TypeScript SDK for Fetch Hive — invoke AI prompts, workflows, and agents from your application.

npm version

Installation

npm install @fetch-hive/sdk
# or
yarn add @fetch-hive/sdk
# or
pnpm add @fetch-hive/sdk

Quick start

import { FetchHive } from '@fetch-hive/sdk';

const client = new FetchHive({ apiKey: process.env.FETCH_HIVE_API_KEY! });

Get your API key from the Fetch Hive dashboard.

Invoke a prompt

const result = await client.invokePrompt({
  deployment: 'my-prompt',
  inputs: { name: 'Alice', topic: 'machine learning' },
  metadata: {},
});
console.log(result.response);

Invoke a prompt (streaming)

for await (const chunk of client.invokePromptStream({
  deployment: 'my-prompt',
  inputs: { name: 'Alice' },
})) {
  if (chunk.type === 'response') process.stdout.write(chunk.response ?? '');
  if (chunk.type === 'usage')    console.log('\nUsage:', chunk.usage);
}

Invoke a workflow

const run = await client.invokeWorkflow({
  deployment: 'my-workflow',
  inputs: { customer_id: '42' },
  metadata: {},
});
console.log(run.status, run.output);

Invoke a workflow (async)

const run = await client.invokeWorkflow({
  deployment: 'my-workflow',
  inputs: { customer_id: '42' },
  async: { enabled: true, callback_url: 'https://example.com/webhook' },
});
console.log('Queued:', run.run_id);

Invoke an agent

const reply = await client.invokeAgent({
  agent: 'my-agent',
  message: 'What is the weather in London?',
  metadata: {},
});
console.log(reply.response);

Metadata

Pass optional metadata on prompt, workflow, or agent invokes to attach flat audit fields for log display and filtering. Metadata values must be strings, numbers, booleans, or null.

Invoke an agent (streaming)

for await (const chunk of client.invokeAgentStream({
  agent: 'my-agent',
  message: 'What is the weather in London?',
  thread_id: 'session-abc123',   // optional — persist conversation history
})) {
  if (chunk.type === 'response') process.stdout.write(chunk.response ?? '');
  if (chunk.type === 'tool')     console.log(`\nCalling tool: ${chunk.tool}`);
  if (chunk.type === 'usage')    console.log('\nUsage:', chunk.usage);
}

Multimodal (image) inputs

const result = await client.invokeAgent({
  agent: 'vision-agent',
  message: 'Describe this image',
  image_urls: ['https://example.com/photo.jpg'],
});
console.log(result.response);

Authentication

Pass the API key to the constructor:

const client = new FetchHive({ apiKey: 'fhk_...' });

Or set the environment variable and omit the explicit key:

export FETCH_HIVE_API_KEY=fhk_...

Configuration

| Option | Default | Description | |---|---|---| | apiKey | process.env.FETCH_HIVE_API_KEY | Bearer token from the Fetch Hive dashboard | | baseURL | https://api.fetchhive.com/v1 | Override the API base URL |

Links

Version

0.3.0

License

MIT — see LICENSE.