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

@rhun/sdk

v0.1.1

Published

TypeScript SDK for interacting with Rhun AI Agents

Readme

Rhun SDK

A TypeScript SDK for interacting with Rhun AI Agents.

Installation

npm install @rhun/sdk

Getting Started

1. Get Your API Key

  1. Visit https://beta.rhun.io
  2. Connect your wallet
  3. Your API key will be available in the account section
  4. Store your API key securely - never commit it to version control

2. Set Up Environment Variables

Create a .env file in your project root:

RHUN_API_KEY=your_api_key_here

Development Setup

If you want to build the SDK from source:

  1. Clone the repository:
git clone https://github.com/rhun-ai/rhun-sdk.git
cd rhun-sdk
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run tests:
npm test

Usage

import { RhunClient } from '@rhun/sdk';

// Initialize the client
const client = new RhunClient({
  apiKey: process.env.RHUN_API_KEY, // Best practice: use environment variables
  baseUrl: 'https://beta.rhun.io'
});

// Create a crypto research agent
const agent = await client.createAgent({
  name: 'Token Scout',
  description: 'Crypto research specialist focusing on token discovery, market analysis, and due diligence. Equipped with comprehensive token database access and real-time market data.',
  coreCapabilities: 'Token search and analysis, market data aggregation, contract verification, liquidity analysis',
  interactionStyle: 'Informative and precise, with clear risk disclaimers',
  analysisApproach: 'Multi-factor analysis combining on-chain data, market metrics, and social signals',
  riskCommunication: 'Detailed risk assessment with contract audit status and liquidity metrics',
  responseFormat: 'Token summary followed by key metrics and risk factors'
});

// Example: Search for tokens and analyze market data
await client.streamChat(agent.id, 'Find new DeFi tokens and analyze their metrics', (chunk) => {
  if (chunk.type === 'message') {
    // Handle narrative responses
    console.log('Analysis:', chunk.data.content);
  } else if (chunk.type === 'tool_invocation') {
    const tool = chunk.data;
    switch (tool.tool) {
      case 'getRecentlyLaunchedCoins':
        // Handle newly launched tokens
        console.log('New tokens:', tool.output.tokens.map(t => ({
          name: t.name,
          chain: t.chain,
          launchDate: t.launchDate
        })));
        break;
      case 'getTokenInfo':
        // Handle detailed token information
        console.log('Token details:', {
          price: tool.output.price,
          volume24h: tool.output.volume24h,
          marketCap: tool.output.marketCap,
          holders: tool.output.holders
        });
        break;
      case 'getTopHolders':
        // Handle holder distribution analysis
        console.log('Top holders:', tool.output.holders.map(h => ({
          address: h.address,
          percentage: h.percentage,
          balance: h.balance
        })));
        break;
      case 'getFearAndGreedIndex':
        // Handle market sentiment data
        console.log('Market sentiment:', tool.output.value, tool.output.classification);
        break;
    }
  }
});

// Example: Get technical analysis with TradingView charts
const response = await client.chat(agent.id, 'Show me technical analysis for SOL');
console.log('Analysis:', response.message.content);

// Update agent with enhanced capabilities
const updatedAgent = await client.updateAgent(agent.id, {
  description: 'Advanced market analyst with real-time technical analysis and sentiment tracking',
  coreCapabilities: 'Technical analysis, market sentiment, holder analysis, trend prediction'
});

API Reference

RhunClient

The main client class for interacting with the Rhun API.

Constructor

new RhunClient(config: RhunClientConfig)
  • config.apiKey: Your Rhun API key (will be sent as a Bearer token)
  • config.baseUrl: (optional) The base URL for the API. Defaults to https://beta.rhun.io

Methods

  • createAgent(config: AgentConfig): Promise<Agent>
  • getAgent(agentId: string): Promise<Agent>
  • updateAgent(agentId: string, config: Partial<AgentConfig>): Promise<Agent>
  • deleteAgent(agentId: string): Promise<void>
  • listAgents(): Promise<Agent[]>
  • chat(agentId: string, message: string): Promise<ChatResponse>
  • streamChat(agentId: string, message: string, onChunk: (chunk: StreamChatResponse) => void): Promise<void>

Types

AgentConfig

Configuration for creating/updating an agent:

Required fields:

  • name: string - Agent name
  • description: string - Agent description

Optional fields:

  • image?: Buffer | string - Agent profile image (Buffer or file path)

Advanced Configuration (all optional):

  • coreCapabilities?: string - Core capabilities and knowledge domains
  • interactionStyle?: string - How the agent should interact
  • analysisApproach?: string - How the agent should analyze problems
  • riskCommunication?: string - How to communicate risks
  • responseFormat?: string - Structure for responses
  • limitationsDisclaimers?: string - Agent limitations
  • prohibitedBehaviors?: string - What the agent must not do
  • knowledgeUpdates?: string - How to handle knowledge updates
  • styleGuide?: string - Communication style guidelines
  • specialInstructions?: string - Special handling instructions
  • responsePriorityOrder?: string - Priority order for responses

System-managed fields (do not set these manually):

  • userId?: string - Set automatically from authentication
  • createdAt?: string - Set automatically on creation
  • updatedAt?: string - Set automatically on updates

Other Types:

  • Agent: An agent instance
  • ChatMessage: A message in a chat
  • ToolInvocation: A tool invocation by an agent
  • ChatResponse: Response from a chat request
  • StreamChatResponse: Response chunk from a streaming chat request

License

MIT