Installation
Requirements
- Node.js 18 or higher (the SDK uses the built-in
fetch) - TypeScript 5.4+ (recommended, not required for JavaScript usage)
Install from npm
npm install ashr-labs
Or with other package managers:
# Yarn
yarn add ashr-labs
# pnpm
pnpm add ashr-labs
Dependencies — what actually gets installed
The core SDK — the client, EvalRunner, RunBuilder, the tool() factory, the agent adapters, and production tracing (client.trace()) — is written against the Node.js standard library only. It does its HTTP over the built-in fetch (hence Node 18+) and ships its own types. No serialization framework, no HTTP client to pin — nothing transitive lands in your node_modules from installing ashr-labs.
The two built-in agent adapters are the only thing that need a provider package, and those are declared as optional peer dependencies — install them only if you use that adapter:
| Adapter | Peer dependency | Install |
|---|---|---|
AnthropicAgent | @anthropic-ai/sdk | npm install @anthropic-ai/sdk |
OpenAIAgent | openai | npm install openai |
FunctionAgent (wrap any function/framework) needs nothing extra. If you bring your own agent object, you don't need either provider SDK.
Install from Source
Clone the repository and build:
git clone https://github.com/ashr-labs/ashr-labs.git
cd ashr-labs/sdk-ts
npm install
npm run build
Development install
To run the test suite or contribute:
git clone https://github.com/ashr-labs/ashr-labs.git
cd ashr-labs/sdk-ts
npm install
This installs additional packages:
vitest— Test runnertypescript— TypeScript compiler@types/node— Node.js type definitions
Verify the install
import { AshrLabsClient } from "ashr-labs";
const client = new AshrLabsClient("tp_your_api_key_here");
console.log(client.toString());
TypeScript Configuration
The SDK ships with full type definitions. For best results, ensure your tsconfig.json includes:
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "bundler",
"target": "ES2022",
"strict": true
}
}
The SDK is published as ESM ("type": "module" in package.json). If your project uses CommonJS, you may need a bundler or dynamic import().
Upgrading
npm install ashr-labs@latest