Amazon Bedrock in Practice

Calling Bedrock from Node.js with AWS SDK v3

Node.js backends can reach Claude on Bedrock through the same modular AWS SDK v3 they already use for the rest of AWS — with TypeScript types, the standard credential chain, and no new vendor secret to manage.

Claude 3P 101 · Updated July 2026 · Unofficial guide

For teams whose services are written in Node.js or TypeScript, calling Claude on Amazon Bedrock does not require adopting a new SDK ecosystem. AWS SDK for JavaScript v3 is modular — you install only the service packages you use — and Bedrock's inference operations live in the @aws-sdk/client-bedrock-runtime package. This article walks through the setup conceptually; for exact class and field names, keep the AWS API reference open alongside it, and note that per this guide's conventions the code samples elsewhere on this site are Python.

The client and the command pattern

Add the runtime package to your project (for example, npm install @aws-sdk/client-bedrock-runtime). SDK v3 uses a client-plus-command pattern: you construct a Bedrock runtime client once, configured with a region, then send command objects through it — one command class per API operation. For Claude, the operations that matter are Converse and ConverseStream (Bedrock's unified conversation APIs, which AWS recommends for a consistent parameter set across models) and InvokeModel / InvokeModelWithResponseStream (the pass-through APIs that take Anthropic's native Messages JSON, including the required "anthropic_version": "bedrock-2023-05-31" field). The trade-offs between the two styles are covered in InvokeModel vs Converse.

Because the SDK is written in TypeScript, request and response shapes are typed: your editor autocompletes message roles and content blocks, and a malformed conversation history fails at compile time rather than at runtime. For enterprises, that type safety is one of the stronger arguments for building the Bedrock integration in TypeScript.

Credentials and region: nothing new to invent

The SDK resolves credentials through the standard AWS precedence chain: explicit configuration first, then environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION), then the shared config file and ambient providers such as SSO, assumed roles, ECS task roles, and EC2 instance metadata. In production the healthy pattern is to attach an IAM role to the compute (Lambda execution role, ECS task role, EC2 instance profile) and configure nothing in code beyond the region. The role needs the IAM actions matching the operations you call — bedrock:Converse, bedrock:ConverseStream, bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream — scoped to the model ARNs you allow.

Sending a Converse request and reading the response

A Converse request carries three things: the model identifier, the full conversation history as alternating user/assistant messages built from typed content blocks, and any system prompt in its dedicated field outside the message list. The response contains the assistant's message (append it to your stored history for the next turn), a stop reason, and usage metadata. For chat-style UIs, send the streaming command instead and render output incrementally as delta events arrive — see the ConverseStream guide for the event flow.

Timeout tip: Claude 4-generation models on Bedrock have an inference timeout of up to 60 minutes, while AWS SDK clients default to about a 1-minute read timeout. For long generations, raise the client's request timeout settings — the same advice AWS gives for every SDK, boto3 included.

Model IDs: check which surface you're on

The bedrock-runtime operations above belong to Bedrock's legacy surface, which uses ARN-versioned model IDs with routing prefixes such as global.anthropic.claude-opus-4-6-v1. The newest models — Claude Fable 5, Opus 4.8, and Sonnet 5 — are not available there. They are served by the current "Claude in Amazon Bedrock" surface, and for that Anthropic ships a dedicated TypeScript client: npm install @anthropic-ai/bedrock-sdk, then new AnthropicBedrockMantle({ awsRegion: "us-east-1" }), calling models like anthropic.claude-opus-4-8 with the standard Anthropic Messages API shape. If your Node.js project is Claude-first rather than multi-model, starting with that SDK is usually the simpler path.

Operational notes

Everything that applies to Bedrock generally applies here: request payloads are capped at 20 MB; calls are recorded as CloudTrail management events by default; and model invocation logging, if enabled, captures full request/response bodies for bedrock-runtime operations. Handle throttling exceptions with retries and backoff as you would for any AWS service — quota behavior is covered in the quota guide.

Where to go next

Understand the request bodies you'll be constructing in the Converse deep dive and InvokeModel in depth, or compare language options with the Java SDK guide and the boto3 setup.

Sources