Supyagent
SDK (Node.js)

SDK (Node.js)

TypeScript SDK for integrating Supyagent Cloud with the Vercel AI SDK — tools, persistence, context management, and React UI components.

SDK (Node.js)

The Supyagent SDK (@supyagent/sdk) lets you build AI-powered chatbot apps in TypeScript. It connects your Vercel AI SDK app to Supyagent Cloud integrations and provides chat persistence, context management, and pre-built React UI components.

Packages

PackageImportWhat it does
@supyagent/sdkimport { supyagent } from '@supyagent/sdk'Core client — fetches tools and skills from Supyagent Cloud
@supyagent/sdk/prismaimport { createPrismaAdapter } from '@supyagent/sdk/prisma'Chat persistence via Prisma (SQLite or PostgreSQL)
@supyagent/sdk/contextimport { createContextManager } from '@supyagent/sdk/context'Token tracking, automatic summarization, and context compactification
@supyagent/sdk/reactimport { ProviderIcon, ToolInput } from '@supyagent/sdk/react'React components for rendering tool calls and results

Quick Start

The fastest way to get started is with create-supyagent-app:

npx create-supyagent-app my-app

This scaffolds a complete Next.js chatbot app with the SDK pre-configured. See the Quickstart guide for details.

Manual Installation

npm install @supyagent/sdk
app/api/chat/route.ts
import { streamText } from 'ai';
import { supyagent, createBashTool } from '@supyagent/sdk';

const client = supyagent({ apiKey: process.env.SUPYAGENT_API_KEY! });

export async function POST(req: Request) {
  const { messages } = await req.json();

  const { systemPrompt, tools: skillTools } = await client.skills({ cache: 300 });
  const tools = { ...skillTools, bash: createBashTool() };

  const result = streamText({
    model: yourModel,
    system: systemPrompt,
    messages,
    tools,
  });

  return result.toDataStreamResponse();
}

In This Section