Access to Anthropic's safety-first language model APIs in TypeScript
2,111
stars
1,266
commits
TypeScript
primary language
Sep 10, 2026
updated
The Claude SDK for TypeScript provides access to the Claude API from server-side TypeScript or JavaScript applications.
Full documentation is available at platform.claude.com/docs/en/api/sdks/typescript.
npm install @anthropic-ai/sdk
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);
TypeScript >= 5.0 is supported.
The following runtimes are supported:
"node" environment ("jsdom" is not supported at this time).dangerouslyAllowBrowser to true.Note that React Native is not supported at this time.
If you are interested in other runtime environments, please open or upvote an issue.
See CONTRIBUTING.md.
This project is licensed under the MIT License. See the LICENSE file for details.
(top 30 of 47)
524 commits
345 commits
109 commits
64 commits
TypeScript
98.0%
JavaScript
1.3%
Access to Anthropic's safety-first language model APIs in TypeScript
2,111
stars
1,266
commits
TypeScript
primary language
Sep 10, 2026
updated
The Claude SDK for TypeScript provides access to the Claude API from server-side TypeScript or JavaScript applications.
Full documentation is available at platform.claude.com/docs/en/api/sdks/typescript.
npm install @anthropic-ai/sdk
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);
TypeScript >= 5.0 is supported.
The following runtimes are supported:
"node" environment ("jsdom" is not supported at this time).dangerouslyAllowBrowser to true.Note that React Native is not supported at this time.
If you are interested in other runtime environments, please open or upvote an issue.
See CONTRIBUTING.md.
This project is licensed under the MIT License. See the LICENSE file for details.
(top 30 of 47)
524 commits
345 commits
109 commits
64 commits
TypeScript
98.0%
JavaScript
1.3%