Back to skills
SkillHub ClubAnalyze Data & AIFull StackData / AI

claude-typescript-sdk

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
125
Hot score
95
Updated
March 20, 2026
Overall rating
C2.8
Composite score
2.8
Best-practice grade
C60.0

Install command

npx @skill-hub/cli install majiayu000-claude-skill-registry-claude-typescript-sdk

Repository

majiayu000/claude-skill-registry

Skill path: skills/data/claude-typescript-sdk

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

Open repository

Best for

Primary workflow: Analyze Data & AI.

Technical facets: Full Stack, Data / AI.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: majiayu000.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install claude-typescript-sdk into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/majiayu000/claude-skill-registry before adding claude-typescript-sdk to shared team environments
  • Use claude-typescript-sdk for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: claude-typescript-sdk
description: Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.
---

# Claude TypeScript SDK

## Quick Start

```bash
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY='your-key'
```

```typescript
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic();
const message = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }],
});
```

## Core Patterns

### Basic Message
```typescript
const message = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Your prompt' }],
});
console.log(message.content[0].type === 'text' && message.content[0].text);
```

### Streaming
```typescript
const stream = client.messages.stream({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Write a poem' }],
});
stream.on('text', (text) => process.stdout.write(text));
const final = await stream.finalMessage();
```

### Tool Use
```typescript
const tools: Anthropic.Tool[] = [{
  name: 'get_weather',
  description: 'Get weather for a location',
  input_schema: {
    type: 'object',
    properties: {
      location: { type: 'string', description: 'City name' },
    },
    required: ['location'],
  },
}];

const response = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  tools,
  messages: [{ role: 'user', content: 'Weather in NYC?' }],
});
```

For detailed examples, see [REFERENCE.md](REFERENCE.md).

## Available Models

- `claude-opus-4-5-20251101` - Most capable
- `claude-sonnet-4-5-20250929` - Balanced
- `claude-haiku-4-5-20251001` - Fastest

## Error Handling

```typescript
try {
  const message = await client.messages.create({...});
} catch (error) {
  if (error instanceof Anthropic.APIError) {
    console.error(`Status: ${error.status}, Message: ${error.message}`);
  }
}
```

## Resources

- [TypeScript SDK GitHub](https://github.com/anthropics/anthropic-sdk-typescript)
- [API Documentation](https://docs.claude.com)
- [Agent SDK Demos](https://github.com/anthropics/claude-agent-sdk-demos)