// Context API: ctx.idempotency_key, ctx.dispatch_job(...).
// Use the right WebhookSignature constructor for your provider; never hand-roll HMAC.
// See: docs/skills/forge-idiomatic-engineer/references/api.md#signature-constructors
use forge::prelude::*;
#[forge::webhook(
path = "/webhooks/{{name}}",
signature = WebhookSignature::hmac_sha256("X-Webhook-Signature", "WEBHOOK_SECRET"),
idempotency = "header:X-Idempotency-Key",
)]
pub async fn {{name}}(ctx: &WebhookContext, payload: serde_json::Value) -> Result<WebhookResult> {
let _ = (ctx, payload);
// TODO: persist or dispatch a job, then choose the right response variant.
Ok(WebhookResult::Ok)
}