npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zhivex-ai/bedrock

v2.0.3

Published

AWS Bedrock adapter for Zhivex AI SDK.

Readme

@zhivex-ai/bedrock

AWS Bedrock adapter for Zhivex AI SDK.

Install

Requires Node.js 20 or newer when running on Node, matching the AWS SDK runtime requirement.

bun add @zhivex-ai/core @zhivex-ai/bedrock

Runtime modes

The default runtime uses Bedrock Runtime Converse through @aws-sdk/client-bedrock-runtime. This keeps existing users on the native AWS path and supports the shared SDK text, streaming, structured output, and callable tool loop.

import { createBedrock } from "@zhivex-ai/bedrock";

const bedrock = createBedrock({
  region: process.env.AWS_REGION
});

const model = bedrock("anthropic.claude-3-5-sonnet-20240620-v1:0");

For production, prefer the standard AWS SDK credential chain: IAM roles, IAM Identity Center / SSO, profiles, or temporary credentials. For exploration and development, Amazon Bedrock API keys are also supported by setting the official AWS_BEARER_TOKEN_BEDROCK environment variable before creating the client:

export AWS_REGION=us-east-1
export AWS_BEARER_TOKEN_BEDROCK=...

You can also pass a Bedrock API key explicitly for native Converse:

const bedrock = createBedrock({
  region: "us-east-1",
  apiKey: process.env.AWS_BEARER_TOKEN_BEDROCK
});

Long-term Bedrock API keys are best kept to exploration and development. For production applications, use short-term credentials or IAM-based AWS SDK authentication.

For Bedrock Mantle/OpenAI-compatible endpoints, opt in with runtime: "openai". This mode sends generation requests to ${baseURL}/responses and is the path for endpoint-dependent Responses features such as server tools or stateful Responses.

import { bedrockServerTool, createBedrock } from "@zhivex-ai/bedrock";
import { generateText } from "@zhivex-ai/core";

const bedrock = createBedrock({
  runtime: "openai",
  apiKey: process.env.BEDROCK_API_KEY,
  baseURL: process.env.BEDROCK_OPENAI_BASE_URL
});

await generateText({
  model: bedrock("openai.gpt-oss-120b-1:0"),
  prompt: "Use the available server tool if useful.",
  tools: {
    notes: bedrockServerTool({
      name: "notes",
      type: "server_tool",
      config: { id: "notes" }
    })
  }
});

AWS's Mantle examples use OPENAI_API_KEY and OPENAI_BASE_URL; pass those values explicitly as apiKey and baseURL if you use that naming. The adapter does not read them automatically so a real OpenAI configuration is not accidentally reused for Bedrock.

AgentCore MCP

For AWS-native remote tool runtimes, keep createBedrock({ runtime: "converse" }) on the native Converse path and expose AgentCore MCP as SDK-managed callable tools:

import { runAgent } from "@zhivex-ai/core";
import { createBedrock, createBedrockAgentCoreMcpToolSet } from "@zhivex-ai/bedrock";

const bedrock = createBedrock({
  region: process.env.AWS_REGION
});

const tools = await createBedrockAgentCoreMcpToolSet(
  {
    runtimeArn: process.env.AGENTCORE_RUNTIME_ARN,
    region: process.env.AWS_REGION,
    bearerToken: process.env.AGENTCORE_BEARER_TOKEN
  },
  {
    toolNamePrefix: "agentcore_",
    maxListPages: 20,
    maxListedTools: 2_000,
    listToolsTimeoutMs: 10_000,
    callToolTimeoutMs: 30_000
  }
);

const result = await runAgent(
  {
    model: bedrock("anthropic.claude-3-5-sonnet-20240620-v1:0"),
    tools,
    maxSteps: 4
  },
  {
    prompt: "Use the AWS AgentCore tools when useful."
  }
);

You can pass either runtimeArn plus region or an explicit AgentCore/Gateway MCP endpoint. The client sends JSON-RPC tools/list and tools/call over HTTP, follows opaque pagination cursors, forwards cancellation to fetch, and preserves the Mcp-Session-Id returned by AgentCore. Token acquisition is intentionally left to the application; pass bearerToken or a full authorization header value.

AgentCore tool annotations are untrusted by default, so SDK-managed tools require local approval even when the server advertises readOnlyHint. Set trustServerToolAnnotations: true only for a server whose annotation integrity you control. Destructive or open-world tools still require approval. Declared MCP outputSchema values are checked against structuredContent, and listing/calls are bounded by the configured page, tool-count, and timeout limits.

Repository and full documentation: