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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@suada/sdk

v1.0.0-rc.28

Published

Official Node.js SDK for Suada AI

Readme

Suada Node.js SDK

The official Node.js SDK for Suada's Business Analyst API. This SDK allows you to easily integrate Suada's powerful business analysis capabilities into your applications and LangChain agents.

Installation

npm install @suada/node

Usage

Basic Usage

import { Suada } from '@suada/node';

const suada = new Suada({
    apiKey: 'your-api-key'
});

// Send a chat message
const response = await suada.chat({
    message: "What's our revenue trend?",
    externalUserIdentifier: 'user-123'
});

console.log(response);

Integration with LangChain

import { Suada } from '@suada/node';
import { AgentExecutor, createOpenAIFunctionsAgent } from 'langchain/agents';
import { ChatOpenAI } from 'langchain/chat_models/openai';
import { PromptTemplate } from 'langchain/prompts';

// Initialize Suada
const suada = new Suada({
    apiKey: 'your-api-key'
});

// Create Suada tool
const suadaTool = suada.createTool({
    name: 'business_analyst',
    description: 'Use this tool to get business insights and analysis',
    externalUserIdentifier: 'user-123',
    passthroughMode: true // Optional, defaults to false
});

// Create OpenAI agent with Suada tool
const model = new ChatOpenAI({ temperature: 0 });
const tools = [suadaTool];

const agent = await createOpenAIFunctionsAgent({
    llm: model,
    tools,
    prompt: PromptTemplate.fromTemplate(
        `You are a helpful assistant that uses Suada's business analyst capabilities.
         
         Current conversation:
         {chat_history}
         
         Human: {input}
         Assistant: Let me help you with that.`
    )
});

const executor = AgentExecutor.fromAgentAndTools({
    agent,
    tools,
    verbose: true
});

// Use the agent
const result = await executor.invoke({
    input: "What's our revenue trend for the last quarter?",
    chat_history: []
});

console.log(result.output);

Passthrough Mode and User Identification

The SDK supports two modes of operation:

  1. Standard Mode (passthroughMode: false, default): In this mode, Suada's AI analyzes the query and provides structured business insights. The externalUserIdentifier is optional.

  2. Passthrough Mode (passthroughMode: true): In this mode, messages are passed directly to the LLM. When using passthrough mode, externalUserIdentifier is required for proper user tracking.

// Standard mode - externalUserIdentifier is optional
const responseStandard = await suada.chat({
    message: "What's our revenue trend?",
    passthroughMode: false // This is the default
});

// Passthrough mode - externalUserIdentifier is required
const responsePassthrough = await suada.chat({
    message: "What's our revenue trend?",
    externalUserIdentifier: 'user-123',
    passthroughMode: true
});

Response Format

The SDK formats responses from Suada's API into a structured string format that can be easily parsed by LangChain agents. The response includes the following sections:

  • ``: Key performance metrics
  • ``: Business insights
  • ``: Action recommendations
  • ``: Potential risks
  • ``: Analysis reasoning
  • ``: Main response text

Example response:

<metrics>
revenue: $1.2M
growth_rate: 15%
</metrics>

<insights>
Strong growth in enterprise segment
New product adoption exceeding expectations
</insights>

<recommendations>
Increase focus on enterprise sales
Expand product feature set
</recommendations>

<risks>
Market competition intensifying
Supply chain constraints
</risks>

<reasoning>
Analysis shows positive growth trajectory with some areas requiring attention
</reasoning>

<response>
Your revenue has shown strong growth, particularly in the enterprise segment...
</response>

Configuration

The SDK accepts the following configuration options:

interface SuadaConfig {
    apiKey: string;
    baseUrl?: string; // Defaults to https://suada.ai/api/public/
}

Error Handling

The SDK throws errors with descriptive messages when API calls fail:

try {
    const response = await suada.chat({
        message: "What's our revenue?",
        externalUserIdentifier: 'user-123'
    });
} catch (error) {
    console.error('Error:', error.message);
}

License

MIT