ClaudeMap

Anthropic TypeScript SDK

Official TypeScript client for the Anthropic API.

SDKs & Toolingofficialsdktypescriptanthropic

Official TypeScript and JavaScript client for the Anthropic API. Tree-shakeable ESM, full TypeScript types, and Node + browser + Deno support. Used by Vercel AI SDK, LangChain.js, and most JS-based agents.

What it does

  • Tree-shakeable ESM + full TypeScript types — bundle-friendly for Vercel/Next.js
  • Native support for Messages, Batch, Files, Token Counting, Vision
  • Works in Node.js, browsers, Deno, Bun, Cloudflare Workers
  • Streaming with delta events + tool-use streaming
  • Vercel AI SDK, LangChain.js, Mastra, and most JS agents consume it

When to use it

Best for browser/Next.js apps calling Claude directly, edge functions on Cloudflare/Vercel, and any TypeScript agent framework that needs streaming responses and tool use. Pairs with Zod for typed tool inputs.

Getting started

npm install @anthropic-ai/sdk

Set ANTHROPIC_API_KEY (and ANTHROPIC_BASE_URL for Bedrock/Vertex) before importing.

Things to know

Pin to a major version in production — the SDK's TypeScript types change between minor releases. Tool-use streaming events require Node 18+ for stable behavior under backpressure.

Repository

anthropics/anthropic-sdk-typescript

Charted

Related on the map

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup