Skip to main content

Installation

Install the Tracia SDK using your preferred package manager:
npm install tracia

Requirements

  • Node.js 18+ (uses native fetch)
  • Works in modern browsers with native fetch support

Configuration

Initialize the Tracia client with your API key:
import { Tracia } from 'tracia';

const tracia = new Tracia({
  apiKey: process.env.TRACIA_API_KEY
});

Configuration Options

OptionTypeRequiredDescription
apiKeystringYesYour Tracia API key (starts with tr_)

Environment Variables

We recommend storing your API key in environment variables:
.env
TRACIA_API_KEY=tr_your_api_key_here
Never commit API keys to version control. Use environment variables or a secrets manager.

TypeScript Support

The SDK is written in TypeScript and exports all types:
import {
  Tracia,
  TraciaOptions,
  RunOptions,
  RunResult,
  TokenUsage,
  Prompt,
  PromptListItem,
  PromptMessage,
  MessageRole,
  CreatePromptOptions,
  UpdatePromptOptions,
  TraciaError,
  TraciaErrorCode,
} from 'tracia';

Next Steps

Prompts SDK

Learn how to run, list, create, update, and delete prompts