agentsclimarketplace

Openevidence webhooks events

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/openevidence-pack/skills/openevidence-webhooks-events

'Webhooks Events for OpenEvidence.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill openevidence-webhooks-events

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.1 KB, 891 tokens by cl100k_base, as published. Nobody here has run it

OpenEvidence Webhooks & Events

Overview

OpenEvidence delivers webhook notifications for clinical evidence retrieval workflows. Subscribe to events when queries complete, evidence bases are updated, new citations are added, or clinical reviews are flagged. Use these webhooks to keep clinical decision support systems current and trigger downstream audit workflows in real time.

Webhook Registration

const response = await fetch("https://api.openevidence.com/v1/webhooks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.OPENEVIDENCE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://yourapp.com/webhooks/openevidence",
    events: ["query.completed", "evidence.updated", "citation.added", "review.flagged"],
    secret: process.env.OPENEVIDENCE_WEBHOOK_SECRET,
  }),
});

Signature Verification

import crypto from "crypto";
import { Request, Response, NextFunction } from "express";

function verifyOpenEvidenceSignature(req: Request, res: Response, next: NextFunction) {
  const signature = req.headers["x-openevidence-signature"] as string;
  const expected = crypto.createHmac("sha256", process.env.OPENEVIDENCE_WEBHOOK_SECRET!)
    .update(req.body).digest("hex");
  if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
    return res.status(401).json({ error: "Invalid signature" });
  }
  next();
}

Event Handler

import express from "express";
const app = express();

app.post("/webhooks/openevidence", express.raw({ type: "application/json" }), verifyOpenEvidenceSignature, (req, res) => {
  const event = JSON.parse(req.body.toString());
  res.status(200).json({ received: true });

  switch (event.type) {
    case "query.completed":
      deliverResults(event.data.query_id, event.data.evidence_count); break;
    case "evidence.updated":
      refreshClinicalCache(event.data.topic_id, event.data.revision); break;
    case "citation.added":
      indexCitation(event.data.citation_id, event.data.pubmed_id); break;
    case "review.flagged":
      escalateReview(event.data.review_id, event.data.flag_reason); break;
  }
});

Event Types

EventPayload FieldsUse Case
query.completedquery_id, evidence_count, confidenceDeliver clinical answers to requester
evidence.updatedtopic_id, revision, sources_changedRefresh cached evidence summaries
citation.addedcitation_id, pubmed_id, journalIndex new literature into knowledge base
review.flaggedreview_id, flag_reason, severityEscalate flagged content for human review
query.failedquery_id, error_code, retry_afterAlert ops and queue retry

Retry & Idempotency

const processed = new Set<string>();

async function handleIdempotent(event: { id: string; type: string; data: any }) {
  if (processed.has(event.id)) return;
  await routeEvent(event);
  processed.add(event.id);
  if (processed.size > 10_000) {
    const entries = Array.from(processed);
    entries.slice(0, entries.length - 10_000).forEach((id) => processed.delete(id));
  }
}

Error Handling

IssueCauseFix
Signature mismatchSecret rotation during deploymentRe-sync secret from OpenEvidence dashboard
Empty evidence_countQuery matched no indexed sourcesCheck query scope and topic coverage
Stale pubmed_idCitation retracted after indexingSubscribe to citation.retracted events
Review escalation loopAutomated re-flag on same contentDeduplicate by review_id with cooldown

Resources

Next Steps

See openevidence-security-basics.

What ships with it: 1 file

2.2 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.