Skip to main content

Sendblue iMessage webhook channel for Zeno.

Project description

zeno-channel-sendblue

Sendblue iMessage webhook channel for Zeno. The first webhook-style channel — use it as the template for any Channel that hosts its own HTTP inbound transport.

Hosts a Starlette + uvicorn server for Sendblue's inbound webhook and posts outbound messages to Sendblue's REST API. Verifies the shared-secret header, enforces a phone-number allowlist, and fires a typing indicator per accepted inbound message.

Install

uv add 'zeno-framework[sendblue]'
# or, without the AI package:
uv add zeno-channel-sendblue

Minimal usage

from zeno.channels.sendblue.channel import SendblueChannel

channel = SendblueChannel(
    api_key_id="...",
    api_secret="...",
    from_number="+15550001111",
    signing_secret="...",            # shared with Sendblue dashboard
    allowed_numbers=("+31600000000",),
    host="127.0.0.1",
    port=8080,
    webhook_path="/webhook",
)
# Then pass it to ZenoApp(channels=[channel]) exactly like any Channel.

See apps/zeno-example-imessage for the complete runnable reference app, including ngrok / Cloudflare Tunnel setup notes.

Behavior

  • Signature verification: Sendblue echoes the configured secret in the sb-signing-secret header. Bad or missing signature → 401. Every other drop (non-iMessage service, group message, unallowlisted sender, malformed JSON, queue full) returns 200 so Sendblue doesn't retry and so the 401 audit signal stays meaningful.
  • Inbound → IncomingMessage: user_id = from_number (E.164), text = content, thread_key = from_number so replies route back. A non-empty media_url becomes an image Attachment.
  • Outbound: text + optional single image via POST /api/send-message. Content over 18,996 chars is truncated (WARNING log) to fit Sendblue's limit.
  • Capabilities: supports_images=True, supports_typing=True, others False.

Testing

uv run pytest packages/zeno-channel-sendblue

Tests use httpx.MockTransport for outbound and the Starlette TestClient for the router. No Sendblue secrets required in CI.

Part of the Zeno framework.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeno_channel_sendblue-1.0.0rc2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeno_channel_sendblue-1.0.0rc2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file zeno_channel_sendblue-1.0.0rc2.tar.gz.

File metadata

  • Download URL: zeno_channel_sendblue-1.0.0rc2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zeno_channel_sendblue-1.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 ac9b3d9c2ca63c2f78da16d4e6a02dbcc7d71de422f7411eca3a933a6c7358c2
MD5 a023b4e66ea328c22e66187b982bd8a4
BLAKE2b-256 bbbee3f8534c24c1ad96358a8a55f6c96914e2a2ed5738fb68a20a4b6f35c184

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_channel_sendblue-1.0.0rc2.tar.gz:

Publisher: publish.yml on nkootstra/zeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zeno_channel_sendblue-1.0.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for zeno_channel_sendblue-1.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b0c6b859cb514e0c7009662abcf91e3e1ae07e2999e23a6848b0d78ebe2fbd5
MD5 a65a8b2372f5a9e1c69e45ecb5fde7b5
BLAKE2b-256 9790f4754b822c00d1f95aee858920f8c45144b9672ee34dfc47fb6c610f02ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_channel_sendblue-1.0.0rc2-py3-none-any.whl:

Publisher: publish.yml on nkootstra/zeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page