Access to Anthropic's safety-first language model APIs
Installations
npm install @anthropic-ai/bedrock-sdk
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Score
57.1
Supply Chain
85.5
Quality
94.9
Maintenance
100
Vulnerability
99.6
License
Releases
bedrock-sdk: v0.12.1
Published on 20 Dec 2024
vertex-sdk: v0.6.2
Published on 20 Dec 2024
sdk: v0.34.0
Published on 20 Dec 2024
vertex-sdk: v0.6.1
Published on 17 Dec 2024
sdk: v0.33.1
Published on 17 Dec 2024
bedrock-sdk: v0.12.0
Published on 17 Dec 2024
Contributors
Languages
TypeScript (94.56%)
Shell (2.8%)
JavaScript (2.53%)
Dockerfile (0.1%)
Developer
Download Statistics
Total Downloads
806,468
Last Day
2,193
Last Week
11,989
Last Month
119,904
Last Year
801,476
GitHub Statistics
788 Stars
546 Commits
85 Forks
115 Watching
9 Branches
638 Contributors
Bundle Size
383.85 kB
Minified
104.35 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.12.0
Package Id
@anthropic-ai/bedrock-sdk@0.12.0
Unpacked Size
125.85 kB
Size
26.00 kB
File Count
43
Publised On
17 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
806,468
Last day
6.3%
2,193
Compared to previous day
Last week
-51.3%
11,989
Compared to previous week
Last month
8.9%
119,904
Compared to previous month
Last year
15,955.2%
801,476
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Anthropic Bedrock TypeScript API Library
This library provides convenient access to the Anthropic Bedrock API.
For the non-Bedrock Anthropic API at api.anthropic.com, see @anthropic-ai/sdk
.
Installation
1npm install @anthropic-ai/bedrock-sdk
Usage
1import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk'; 2 3// Note: this assumes you have configured AWS credentials in a way 4// that the AWS Node SDK will recognise, typicaly a shared `~/.aws/credentials` 5// file or `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY` environment variables. 6// 7// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html 8const client = new AnthropicBedrock(); 9 10async function main() { 11 const message = await client.messages.create({ 12 model: 'anthropic.claude-3-5-sonnet-20241022-v2:0', 13 messages: [ 14 { 15 role: 'user', 16 content: 'Hello!', 17 }, 18 ], 19 max_tokens: 1024, 20 }); 21 console.log(message); 22} 23 24main();
For more details on how to use the SDK, see the README.md for the main Anthropic SDK which this library extends.
Requirements
TypeScript >= 4.5 is supported.
The following runtimes are supported:
- Node.js 18 LTS or later (non-EOL) versions.
- Deno v1.28.0 or higher, using
import { AnthropicBedrock } from "npm:@anthropic-ai/bedrock-sdk"
. - 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.
Note that React Native is not supported at this time.
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
No vulnerabilities found.
No security vulnerabilities found.