puppetwatch

Integration documentation

Two calls: tell us what happened, and ask us before something risky happens.

Setup overview

  1. Create your project.
  2. Install the SDK.
  3. Report events.
  4. Protect sensitive actions.

Install

npm install @puppetwatch/sdk

Report events

puppetwatch.identify(currentUser.id);

puppetwatch.capture("analysis_requested", {
  target_type: "ai_inference",
  target_id: demo.id,
});

identify() associates activity with a pseudonymous account. capture() reports an event and its target metadata.

Protect a sensitive action

const decision = await puppetwatch.guard(currentUser.id, {
  targetType: "analysis_requested",
});

if (decision.action === "block") {
  // deny the request
}

capture() never blocks anything on its own. guard() is what lets you actually stop a bad actor. Call it right before the action happens, and act on what it returns (allow, block, require a CAPTCHA, and more).

Data sent in these examples

ValuePurpose
currentUser.idPseudonymous account identifier.
analysis_requestedName of the event or sensitive action.
target_typeType of resource involved in the captured event.
target_idIdentifier of the target involved in the captured event.
targetTypeAction type submitted to guard for a decision.

Send pseudonymous IDs and event metadata. No emails or message content required.

Contact us for integration help.