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

@facet-llc/origination-aws-agentcore

v0.2.2

Published

Facet helpers for AWS Bedrock AgentCore Payments. Includes a TypeScript port of the canonical Python PaymentManager class (agent-side x402 header generation via the official @aws-sdk/client-bedrock-agentcore) and an IssuerDirectVerifier fallback for unatt

Readme

@facet-llc/origination-aws-agentcore

Helpers for integrating Facet with AWS Bedrock AgentCore Payments.

What this is

Two complementary surfaces.

1. PaymentManager: agent-side x402 orchestration

A TypeScript port of the canonical Python PaymentManager class from bedrock-agentcore-sdk-python (bedrock_agentcore.payments.manager). It wraps the official @aws-sdk/client-bedrock-agentcore v3 client with the same workflow logic the Python SDK provides:

  • Auto-injects paymentManagerArn on every data-plane call.
  • Generates idempotency clientTokens automatically.
  • Mirrors the Python method surface 1:1. createPaymentInstrument, createPaymentSession, processPayment, getPaymentInstrumentBalance, list / get / delete helpers, and the orchestrated generatePaymentHeader that produces an x402 X-PAYMENT (v1) or PAYMENT-SIGNATURE (v2) header from a 402 challenge.
import { BedrockAgentCoreClient } from "@aws-sdk/client-bedrock-agentcore";
import { PaymentManager } from "@facet-llc/origination-aws-agentcore";

const client = new BedrockAgentCoreClient({ region: "us-east-1" });
const manager = new PaymentManager({
  paymentManagerArn: "arn:aws:bedrock-agentcore:us-east-1:123456789012:payment-manager/PM-A",
  client,
  agentName: "my-procurement-agent",
});

const session = await manager.createPaymentSession({
  expiryTimeInMinutes: 60,
  userId: "user-42",
  limits: { maxSpendAmount: { value: "100.00", currency: "USD" } },
});

// Hit a merchant endpoint, get a 402 back, then have the manager
// build the X-PAYMENT header for the follow-up request:
const challenge = await fetch("https://merchant.example.com/v1/checkout");
if (challenge.status === 402) {
  const header = await manager.generatePaymentHeader({
    paymentInstrumentId: "pi-1",
    paymentSessionId: session.paymentSessionId!,
    userId: "user-42",
    paymentRequiredRequest: {
      statusCode: 402,
      headers: Object.fromEntries(challenge.headers),
      body: await challenge.text(),
    },
  });
  // header is either { "X-PAYMENT": "<base64>" } (v1) or
  // { "PAYMENT-SIGNATURE": "<base64>" } (v2)
  await fetch("https://merchant.example.com/v1/checkout", { headers: header });
}

The merchant on the other side verifies the x402 header via @facet-llc/payment-adapter-x402-coinbase. There is no AgentCore-specific verification on the merchant side because AWS does not publish an attestation endpoint for these payments. That is intentional. AgentCore's contract with merchants is x402.

2. IssuerDirectVerifier: fallback for unattested x402 flows

A FacetOriginationVerifier that maps a raw wallet attestation string to a direct:<wallet> aid. The Terminal registers it as the default fallback for traffic that does not carry a platform-specific attestation.

The verifier fails closed on attestations larger than 8 KB and sanitizes input character sets before parsing.

Install

npm install @facet-llc/origination-aws-agentcore @aws-sdk/client-bedrock-agentcore
# or
pnpm add @facet-llc/origination-aws-agentcore @aws-sdk/client-bedrock-agentcore

Spec fidelity

PaymentManager is a method-for-method port of the canonical Python class. When the upstream Python SDK adds, removes, or changes a method, mirror the change here. The Python source the port tracks is at bedrock_agentcore/payments/manager.py in bedrock-agentcore-sdk-python.

License

Apache-2.0. See LICENSE.