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

@openbindings/asyncapi

v0.1.0

Published

OpenBindings AsyncAPI binding executor

Readme

@openbindings/asyncapi

AsyncAPI 3.x binding executor and interface creator for the OpenBindings TypeScript SDK.

This package enables OpenBindings to execute operations against AsyncAPI specs and synthesize OBI documents from them. It supports HTTP/SSE for event streaming, HTTP POST for sending messages, and WebSocket for bidirectional communication. Documents are parsed with js-yaml and $ref pointers resolved with @openbindings/sdk's built-in dereferencer (browser-safe, no Node.js dependencies). Credentials are applied via the spec's security schemes.

See the spec and pattern documentation for how executors and creators fit into the OpenBindings architecture.

Install

npm install @openbindings/asyncapi

Requires @openbindings/sdk (the core SDK).

Usage

Register with OperationExecutor

import { OperationExecutor } from "@openbindings/sdk";
import { AsyncAPIExecutor, AsyncAPICreator } from "@openbindings/asyncapi";

const exec = new OperationExecutor([new AsyncAPIExecutor(), new AsyncAPICreator()]);

The executor declares asyncapi@^3.0.0 — it handles any AsyncAPI 3.x spec.

Execute a binding

const executor = new AsyncAPIExecutor();

for await (const event of executor.executeBinding({
  source: {
    format: "[email protected]",
    location: "https://api.example.com/asyncapi.json",
  },
  ref: "#/operations/sendMessage",
  input: { text: "hello" },
  context: { bearerToken: "tok_123" },
})) {
  if (event.error) console.error(event.error.message);
  else console.log(event.data);
}

Create an interface from an AsyncAPI spec

const creator = new AsyncAPICreator();

const iface = await creator.createInterface({
  sources: [{
    format: "[email protected]",
    location: "https://api.example.com/asyncapi.json",
  }],
});

How it works

Execution flow

  1. Parses the AsyncAPI document (YAML or JSON) and resolves all $ref pointers
  2. Resolves the operation by ref, determines server URL and protocol
  3. Dispatches based on action and protocol:
    • receive + http/https: SSE event stream
    • receive + ws/wss: WebSocket stream
    • send + http/https: HTTP POST (unary)
    • send + ws/wss: WebSocket stream (bidirectional)

Credential application

Credentials are applied based on the AsyncAPI spec's security configuration:

  • http + bearer: Sets Authorization: Bearer <token> from bearerToken context field
  • http + basic: Sets Authorization: Basic <encoded> from basic.username/basic.password context fields
  • apiKey: Places the apiKey context field in the header, query param, or cookie as the spec declares
  • httpBearer: Same as http+bearer
  • userPassword: Maps to basic auth

When no security schemes are defined, falls back to bearer -> basic -> apiKey in that order.

For WebSocket connections, the bearer token is sent in the first message body (browsers cannot set headers on WebSocket upgrades). Query-param apiKeys are appended to the WebSocket URL.

Interface creation

Converts an AsyncAPI 3.x document into an OBI by:

  • Parsing YAML/JSON and resolving all $ref pointers
  • Iterating operations sorted alphabetically for deterministic output
  • Extracting input schemas from send operation payloads
  • Extracting output schemas from receive operation payloads and reply payloads
  • Generating #/operations/<id> refs for each binding

Supported protocols

| Protocol | Receive (subscribe) | Send (publish) | |----------|-------------------|----------------| | HTTP/HTTPS | SSE streaming | POST (unary) | | WS/WSS | WebSocket streaming | WebSocket streaming |

License

Apache-2.0