JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q93627F

Package Exports

  • hive-intelligence
  • hive-intelligence/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hive-intelligence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿง  Hive Intelligence TypeScript SDK

The Hive Intelligence SDK lets you integrate real-time crypto and Web3 intelligence into your JavaScript or TypeScript apps using simple prompt or chat-style inputs.

๐Ÿš€ Installation

Using npm:

npm install hive-intelligence

Or using yarn:

yarn add hive-intelligence

๐Ÿ”‘ Setup

Set your Hive API key as an environment variable:

export HIVE_API_KEY=your_api_key_here

๐Ÿงช Example Usage

import { HiveSearchClient } from 'hive-intelligence';
import { HiveSearchRequest, HiveSearchMessage, HiveSearchResponse} from 'hive-intelligence';

// Get API key from env
const apiKey = process.env.HIVE_API_KEY;
if (!apiKey) {
  throw new Error('Please set the HIVE_API_KEY environment variable');
}

// Initialize client
const client = new HiveSearchClient(apiKey);

// ๐ŸŸก Example 1: Prompt-based query
const promptRequest: HiveSearchRequest = {
  prompt: 'What is the current price of Ethereum?'
};

client.search(promptRequest).then((response: HiveSearchResponse) => {
  console.log('Prompt Response:', response);
}).catch(console.error);

// ๐ŸŸข Example 2: Chat-style query
const chatRequest: HiveSearchRequest = {
  messages: [
    { role: 'user', content: 'Price of' },
    { role: 'assistant', content: 'Price of what?' },
    { role: 'user', content: 'BTC' }
  ]
};

client.search(chatRequest).then((response: HiveSearchResponse) => {
  console.log('Chat Response:', response);
}).catch(console.error);

๐Ÿ“˜ Request Options

  • prompt: Plaintext question or query
  • messages: Array of { role, content } for chat
  • Optional parameters:
    • temperature: (e.g. 0.7) randomness of response
    • top_k: max tokens considered
    • top_p: nucleus sampling
    • include_data_sources: show source info

โ— Error Handling

On error, the SDK throws HiveSearchAPIError with:

  • status: HTTP status code
  • statusText: status message
  • body: full API response