Skip to content

spectrum-ts v4.2.0

Latest

Choose a tag to compare

@photon-action-bot photon-action-bot released this 13 Jun 09:13

New Features

  • app.webhook() now handles both native Spectrum Cloud webhooks and Fusor webhooks through the same method. Native webhooks are HMAC-signed JSON and still arrive in your handler as the familiar (space, message) pair.

  • Added webhookSecret support, with SPECTRUM_WEBHOOK_SECRET as a fallback, so native webhook signatures can be verified before your handler runs.

  • Added first-party webhook adapters for Hono, Express, and Elysia: spectrum-ts/hono, spectrum-ts/express, and spectrum-ts/elysia. These mount the endpoint for you and handle raw request bodies correctly. 🔌

  • Native webhook payloads now deserialize Spectrum content like text, attachments, contacts, rich links, reactions, and groups into normal SDK messages.

Bug Fixes

  • Fixed webhook format detection to use the payload shape instead of X-Spectrum-Signature. Both native and Fusor deliveries can include that header, so this prevents valid Fusor webhooks from being routed incorrectly.

Improvement

  • Added docs and tests for native webhooks, signature verification, payload deserialization, and the new framework plugins. This makes setup clearer and helps protect the raw-body behavior required for secure webhook verification. ✨

Version: 4.2.0