Skip to main content

Install the SDK

npm install aden-ts dotenv
Or with other package managers:
npm install aden-ts dotenv

Install Provider SDKs

Install the LLM provider SDKs you plan to use:
npm install openai

Environment Setup

Create a .env file in your project root:
OPENAI_API_KEY=sk-xxx
ADEN_API_URL=https://kube.acho.io # Use http://localhost:4000 if using self-hosting
ADEN_API_KEY=your-aden-api-key
Don’t have an Aden API key yet? You can still use the SDK locally with the console emitter for testing.
If you are using self-hosting, use http://localhost:4000 as the ADEN_API_URL.

Requirements

RequirementVersion
Node.js>= 18.0.0
TypeScript>= 5.0.0 (optional)

Peer Dependencies

PackageVersionRequired
openai>= 4.0.0If using OpenAI
@anthropic-ai/sdk>= 0.20.0If using Anthropic
@google/generative-ai>= 0.1.0If using Gemini

Verify Installation

Create a simple test file:
import "dotenv/config";
import { instrument, createConsoleEmitter, uninstrument } from "aden-ts";
import OpenAI from "openai";

async function main() {
  // Instrument the SDK
  const result = await instrument({
    emitMetric: createConsoleEmitter({ pretty: true }),
    sdks: { OpenAI },
  });

  console.log("Instrumented:", result);
  // Output: { openai: true, anthropic: false, gemini: false }

  // Clean up
  await uninstrument();
}

main();
Run the test:
npx tsx test.ts

TypeScript Configuration

For TypeScript projects, ensure your tsconfig.json includes:
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "esModuleInterop": true,
    "strict": true
  }
}

CommonJS vs ESM

The SDK supports both module formats:
import { instrument, createConsoleEmitter } from "aden-ts";

Next Steps

Quick Start

Learn how to instrument your first LLM application