LoopQuest
← All integrations
TypeScript / Node SDK logo

TypeScript / Node SDK

Code / SDK

A typed client for Node and the edge — one call to create a review task.

In plain English

LoopQuest is a place where a person quickly checks the work an AI or automation has done. Connecting TypeScript / Node SDK means that whenever TypeScript / Node SDK produces something that should be looked at by a human, it sends that item to LoopQuest. Someone on your team reviews it in a few seconds, and their decision is sent straight back to TypeScript / Node SDK so the rest of your process can carry on, with a real person accountable for the call.

When you'd use it

You're building the automation yourself in TypeScript. The SDK wraps auth, ingest, status polling and webhook signature verification so you ship human-in-the-loop in a few lines instead of hand-rolling HTTP.

What you'll need

  • A free LoopQuest account. Sign up if you don't have one.
  • A project and its API key — find it under Workspaces → your project → API keys. The key is how TypeScript / Node SDK proves it's allowed to send you work.
  • An account on TypeScript / Node SDK itself, with the workflow or agent you want to add a human check to.

How to set it up

  1. 1Install the package: npm i @tomphillipsai/loopquest-sdk.
  2. 2Construct a client with your project API key from an env var.
  3. 3Call createTask with a module and payload; pass a callback_url for the verdict.
  4. 4Verify the webhook signature with the SDK helper before acting on a verdict.

Copy-paste starting point:

import { LoopQuest } from "@tomphillipsai/loopquest-sdk";

const lq = new LoopQuest({ apiKey: process.env.LOOPQUEST_KEY });
const { id } = await lq.createTask({
  module: "swiper",
  payload: { content },
  callback_url: "https://your-app.com/loopquest/verdict",
});

Recipes: gate or monitor

Two ways to put a human in the loop with TypeScript / Node SDK. A gate blocks until someone approves; a monitor reviews in the background without slowing anything down.

For gating, TypeScript / Node SDK sits in the full control (code & visual builders) group. How it works →

Gate — block until approved

With TypeScript / Node SDK you control the call, so you await the verdict directly before doing anything consequential.

⚙️TypeScript / Node SDKyour code
{ }POST taskmode: "gate"
Await verdictpoll or webhook
Approve, it proceeds
Reject, it stops
  1. 1POST the output to /api/v1/tasks with a mode of "gate" and a timeout_seconds.
  2. 2Poll GET /api/v1/tasks/{id} until the status is no longer "pending", or receive the signed webhook.
  3. 3Continue on an approve, halt on a reject. If it times out, it resolves fail-closed on its own.
  4. 4Verify the X-LoopQuest-Signature on any webhook before trusting it.

Monitor — review without blocking

Monitor mode never holds TypeScript / Node SDK up. The flow proceeds immediately and LoopQuest reviews a copy for quality.

⚙️TypeScript / Node SDKproceeds now
Doneno wait
👤Copy reviewed by a human
📈Quality metrics & alerts
  1. 1Send the output with a mode of "monitor" and don't wait on the result.
  2. 2TypeScript / Node SDK carries straight on, nothing is blocked.
  3. 3Verdicts are logged and scored over time. Sample a fraction for QA, or review every item.

What happens after a review

The moment a reviewer decides, LoopQuest sends the result back to the web address you gave it (your callback_url). The message says what was decided, whether it was approved, flagged, which option was picked, or the corrected values, so your automation can act on it automatically.

For developers: each callback is signed with an X-LoopQuest-Signature HMAC header. Verify it before trusting the payload. Full details are in the API reference.

Stuck, or want this set up for you? Email tom@tomphillips.uk and we'll walk you through it.