RoboHub

This page was generated from the source of RoboHub. Edit the source, not this page.

robohub-provider-webhook

An alert channel that posts each alert to an HTTP endpoint — a chat service's
incoming webhook, a home automation server, a script of your own. It implements
the robohub.alert interface (its send), and the application calls
alert.raise(...), never the provider (see robohub-alert/index).

Binding it

deps:
  robohub:
    robohub-alert: ">=1.1.0"
    robohub-provider-webhook: ">=0.2.0"

bind:
  robohub.alert:
    providers: [robohub-provider-webhook]
    config:
      robohub-provider-webhook:
        url: "https://hooks.example.com/robohub"
        content_type: application/json

Settings

SettingDefaultWhat it is
url—The endpoint; required, http:// or https://
content_typeapplication/x-www-form-urlencodedA type containing json posts {"level","message","metadata"} as JSON; anything else posts the same three fields as a form
authorization—When set, sent as the Authorization header exactly as written (Bearer <token>)
severity_thresholdeverythingThe lowest level posted: INFO, WARNING, ERROR, CRITICAL
enabledon"false" stops the channel

The body and the Authorization header are passed to curl through files (the
header through an owner-only one), never on a command line. An HTTP error is a
failure: send answers 1 only when the endpoint accepted the post.

Release history

[0.1.0] - 2026-11-02

The generic HTTP provider for the alert contract.

[0.2.0] - 2026-11-12

A provider of the alert interface: the module lists robohub.alert under implements and exports send(level, message, metadata), which posts the alert to url. Its settings are declared under provides.settings and read with rho_bind_config, from the binding of the application that uses it; the provider: block and the key=value; configuration string are gone, and the alert plugin that wrapped it was removed.

[0.2.1] - 2026-11-13

An HTTP error is a failure, not a delivery (-f). A content type of application/json sends a JSON body. The URL must be http or https.

[0.2.2] - 2026-11-14

Trimming, URL escapes, form fields and decimals come from the toolchain (rho 0.7.0: str_trim, str_url_encode/str_url_decode, form_field, milli_*) rather than this module's own copy, the same on both backends. Needs rho 0.7.0. A form value escapes every reserved byte; a space is %20.

[0.2.3] - 2026-11-14

The authorization header reaches curl from an owner-only file rather than its command line, and a URL or header with a line break is refused.

[0.2.4] - 2026-11-14

Its data is kept where app_workspace() says (rho 0.8.0) — the application's workspace, else ~/.rho/apps/<app> — so two applications started by hand no longer share this module's records. Needs rho 0.8.0.