← Back to list

claude-typescript-sdk
by Anveio
⭐ 0🍴 0📅 Dec 17, 2025
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
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY='your-key'
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
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
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
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.
Available Models
claude-opus-4-5-20251101- Most capableclaude-sonnet-4-5-20250929- Balancedclaude-haiku-4-5-20251001- Fastest
Error Handling
try {
const message = await client.messages.create({...});
} catch (error) {
if (error instanceof Anthropic.APIError) {
console.error(`Status: ${error.status}, Message: ${error.message}`);
}
}
Resources
Score
Total Score
40/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon