Webhooks¶
from kioko import WebhookSink
memory.subscribe(WebhookSink("https://hooks.example.com/memory", secret=os.environ["HOOK_SECRET"],
events=["memory.added", "memory.updated"])) # prefixes like "memory." work too
Each event is POSTed as JSON from a background thread, so a slow or failing receiver never slows the
agent. Each request carries X-Kioko-Event and X-Kioko-Delivery headers and, with a secret,
X-Kioko-Signature: sha256=<HMAC>. Check the signature with
kioko.sinks.verify_signature(secret, body, header). From the CLI:
kioko serve --webhook URL --webhook-secret-env HOOK_SECRET.