@anthropic-ai/sdk
The official TypeScript library for the Anthropic API
About
The official TypeScript library for the Anthropic API
What detecting @anthropic-ai/sdk tells you about a site
@anthropic-ai/sdk reveals an integration with Anthropic's Claude models. Like other model SDKs it is key-bearing and server-side by design, so a client-side appearance signals a leaked credential. Its presence tells you the product builds on Claude specifically — often for longer-context reasoning, tool use or agentic features.
Why the exact @anthropic-ai/sdk version matters
The SDK tracks Anthropic's API and model families (message streaming, tool use, the latest Claude versions); the exact version tells you which API capabilities the integration can use.
@anthropic-ai/sdk in a real-world stack
When you find @anthropic-ai/sdk in a bundle, it rarely travels alone. Frequently the Vercel ai SDK as a unifying layer, and a server runtime holding the API key.
Quick facts
npm install @anthropic-ai/sdkCommon pairings
Packages this one expects to find in the same project. Each is also a Sourcemap Explorer detection target.
What @anthropic-ai/sdk pulls in
@anthropic-ai/sdk declares 2 direct dependencies — each one also rides into any bundle that ships @anthropic-ai/sdk, so they are detection targets too. Reading them is a quick way to understand the package's real footprint .
How Sourcemap Explorer detects @anthropic-ai/sdk
@anthropic-ai/sdk ships as v0.115.0, published 2026-07-24 and carries 2 direct dependencies, 1 peer dependency (zod), 195 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when @anthropic-ai/sdk rides inside a deployed bundle — here is how the detection works.
We catch @anthropic-ai/sdk from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/@anthropic-ai/sdk/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.
- 1
Confirm the site exposes sourcemaps
In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `@anthropic-ai/sdk` paths live.
- 2
Find the package in the bundle
Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/@anthropic-ai/sdk/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/@anthropic-ai/sdk/package.json` gives you the exact installed version.
- 3
Read the version directly from package.json
Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/@anthropic-ai/sdk/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.
Recent security advisories for @anthropic-ai/sdk
The 2 most recent advisories affecting some versions of @anthropic-ai/sdk, aggregated from OSV.dev (GitHub Advisory + CVE data). A listing here doesn't mean the version a given site ships is affected — each advisory applies to a specific version range. Sourcemap Explorer reads the exact bundled version so you can check it against these ranges.
Claude SDK for TypeScript has Insecure Default File Permissions in Local Filesystem Memory Tool
Claude SDK for TypeScript: Memory Tool Path Validation Allows Sandbox Escape to Sibling Directories
Recent versions
@anthropic-ai/sdk README
Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.
Claude SDK for TypeScript
The Claude SDK for TypeScript provides access to the Claude API from server-side TypeScript or JavaScript applications.
Documentation
Full documentation is available at platform.claude.com/docs/en/api/sdks/typescript.
Installation
npm install @anthropic-ai/sdk
Getting started
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
model: 'claude-opus-4-6',
});
console.log(message.content);
Requirements
TypeScript >= 4.9 is supported.
The following runtimes are supported:
- Node.js 20 LTS or later (non-EOL) versions.
- Deno v1.28.0 or higher.
- Bun 1.0 or later.
- Cloudflare Workers.
- Vercel Edge Runtime.
- Jest 28 or greater with the
"node"environment ("jsdom"is not supported at this time). - Nitro v2.6 or greater.
- Web browsers: disabled by default to avoid exposing your secret API credentials (see API key best practices). Enable browser support by explicitly setting
dangerouslyAllowBrowsertotrue.
Note that React Native is not supported at this time.
If you are interested in other runtime environments, please open or upvote an issue.
Contributing
See CONTRIBUTING.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
FAQ
What is @anthropic-ai/sdk used for?
The official TypeScript library for the Anthropic API
How can I tell if a website is using @anthropic-ai/sdk?
Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `@anthropic-ai/sdk` from two complementary signals: `node_modules/@anthropic-ai/sdk/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.
How do I find out which version of @anthropic-ai/sdk a website is running?
Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `@anthropic-ai/sdk/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/@anthropic-ai/sdk/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 0.115.0, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.
What is the latest version of @anthropic-ai/sdk?
0.115.0, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.
Is @anthropic-ai/sdk actively maintained?
Very actively maintained — the last release shipped within the past three months. The last published release was 2026-07-24. Source code: https://github.com/anthropics/anthropic-sdk-typescript.
Does @anthropic-ai/sdk have known security vulnerabilities?
2 recent advisories affecting some versions of @anthropic-ai/sdk are listed in the "Recent security advisories" section above, aggregated from OSV.dev (GitHub Advisory + CVE data). Whether a particular site is exposed depends entirely on the exact version it ships — each advisory applies to a specific version range, not to the package as a whole. That is why the precise bundled version matters: Sourcemap Explorer reads the version a site actually runs, so you can check it against the affected ranges instead of assuming the latest release is what's deployed.
Where can I read more?
Project homepage: https://github.com/anthropics/anthropic-sdk-typescript#readme. Source code: https://github.com/anthropics/anthropic-sdk-typescript. Published on npm: https://www.npmjs.com/package/@anthropic-ai/sdk. Licensed as MIT.
Detected by Sourcemap Explorer
When a bundle ships sourcemaps, we read the embedded package.json for @anthropic-ai/sdk and report the precise version (the registry's latest is v0.115.0, published 2026-07-24; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.