Skip to content

[v1.2] Support pluggable webhook server backend (aiohttp / Flask / FastAPI / Express) #118

@MaxMansfield

Description

@MaxMansfield

Context

The SDK currently bundles its own webhook HTTP server (http.server.BaseHTTPRequestHandler in Python; stock Node http module in Node.js). Apps that already use aiohttp / Flask / FastAPI / Express / Lambda have to choose:

  • Run TWO HTTP servers in the same process (the SDK's + their own), or
  • Abandon @rtms.on_webhook_event and reimplement webhook routing themselves

Neither is acceptable for production deployments at scale. SQS-replay failover (the canonical production pattern) specifically needs the webhook ingest layer to be Lambda or aiohttp, decoupled from the RTMS client lifecycle.

What to ship

Opt-in factory pattern. App provides its own HTTP router; the SDK exposes a callable that the app mounts at the webhook path:

# Python — FastAPI integration example
from fastapi import FastAPI, Request
app = FastAPI()

handler = rtms.webhook_handler(on_event=my_callback)

@app.post("/webhook")
async def webhook(request: Request):
    payload = await request.json()
    return await handler(payload, request.headers)
// Node.js — Express integration example
const handler = rtms.webhookHandler({ onEvent: myCallback });
app.post("/webhook", express.json(), (req, res) => handler(req.body, req.headers, res));

The existing @rtms.on_webhook_event + rtms.run() path stays for the simple/quickstart case. The factory is the production path.

Acceptance criteria

  • Python: rtms.webhook_handler(...) returns an async callable
  • Node.js: rtms.webhookHandler(...) returns a request handler compatible with Express middleware shape
  • FastAPI, aiohttp, Flask integration samples in examples/python.md
  • Express integration sample in examples/node.md
  • Existing @rtms.on_webhook_event quickstart path continues to work unchanged

Cross-language parity

  • Same constructor parameter names where idiomatic
  • Same callback signature (payload, headers/request, response)
  • Both ship in the same release
  • PR description includes "Cross-language parity check" section

Source

Tracked in vault: Projects/RTMS SDK v1.2.md → DEVS-X6.

Tracker

Part of the v1.2 milestone. Project: https://github.com/orgs/zoom/projects/11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXQuality-of-life or DX improvement to the SDKcloud deployAffects Docker / ECS / Fargate / Kubernetes deploymentslanguage parityRequires parallel implementation in Node.js and Python with parity check in PRv1.2Part of the v1.2 release

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions