Skip to main content

TypeScript SDK Installation

Install Package

bun add @mutagent/sdk

TypeScript Configuration

The SDK requires TypeScript 5.0+ for full type support.
// tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}

Initialize Client

import { Mutagent } from '@mutagent/sdk';

const client = new Mutagent({
  bearerAuth: process.env.MUTAGENT_API_KEY,
});

Verify Setup

// Test your connection
const { prompts } = await client.prompt.getApiPrompt({ limit: 1 });
console.log('Connection successful!');
console.log('Found', prompts?.length ?? 0, 'prompts');

What’s Exported

import {
  Mutagent,           // Main client class
  MutagentError,      // Error class
  SDKOptions,         // Client configuration type
  HTTPClient,         // Custom HTTP client interface
} from '@mutagent/sdk';