Skip to content

[Feat]: Edge Runtime Support #218

@drew-foxall

Description

@drew-foxall

Is your feature request related to a problem? Please describe.

PR #71 made Express optional, but the SDK still can't run on edge runtimes
(Cloudflare Workers, Deno, Bun) because:

  1. DefaultExecutionEventBus uses Node.js EventEmitter
  2. Extension utilities (HTTP_EXTENSION_HEADER, getRequestedExtensions) aren't exported

This forces anyone wanting Hono/Fastify support to maintain a full fork.

Describe the solution you'd like

1. Replace EventEmitter with EventTarget

  • Web-standard API available in all modern runtimes
  • Node.js 15+ has native EventTarget support
  • Maintains same public API

2. Export extension utilities

// In src/server/index.ts
export { HTTP_EXTENSION_HEADER } from '../constants.js';
export { getRequestedExtensions } from './utils.js';

Benefits

  • ✅ Native Cloudflare Workers support (no nodejs_compat)
  • ✅ Native Deno/Bun support
  • ✅ Browser compatibility
  • ✅ Enables community framework adapters
  • ✅ Smaller bundle for edge deployments

Describe alternatives you've considered

I've implemented this in my fork: https://github.com/drew-foxall/a2a-js-sdk

Additional context

I've also used my fork to create working implementations using hono to create alternate versions of the a2a-examples https://github.com/drew-foxall/a2a-js-sdk-examples

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions