Skip to content

Quick start

The quickest way in is the TypeScript SDK, @raku-technologies/sight (MIT, no dependencies, Node 18 or later). Any other language can call the HTTP API directly.

1. Install

npm install @raku-technologies/sight

2. Create a client on your server

import { ChecksClient } from "@raku-technologies/sight";

const checks = new ChecksClient({
  baseUrl: "https://sightapi.raku.so",
  apiKey: process.env.SIGHT_API_KEY!,   // made in the console: Company → API keys
});

Keep the key on your server

The key identifies your account. Never put it in a phone app or a web page: your app sends photos to your server, and your server talks to Sight.

3. Send a photo as it is taken

await checks.addPhoto({
  jobId: task.id,                  // your own id for the job: opened on first use
  template: "site-completion",     // the template set up for your account
  slot: "front_view",              // which photo this is, as the template names it
  photoId: upload.id,              // your own id for the photo: resends are harmless
  imageUrl: presignedUrl,          // any https link Sight can read for a few minutes
  site: { key: location.id },      // for "unique per site" checks
});

imageUrl is usually a presigned link to the photo in your own storage (S3, Azure, Google Cloud): the photo never has to pass through your server.

4. Read the result

const job = await checks.getJob(task.id);

job.verdict;          // "pass" | "fail" | "needs_review" | "incomplete"
job.still_missing;    // what the user still has to do, with an `ask` for each
for (const check of job.checks) {
  console.log(check.name, check.outcome, check.reason);
}

Or wait for it:

const done = await checks.waitForJob(task.id);            // until nothing is left to check
for await (const state of checks.watchJob(task.id)) {     // each new state as it changes
  render(state);
}

Or have every result sent to your app instead of asking.

5. When the work is finished

await checks.complete(task.id);   // no more photos: anything still missing now fails

Everything else

await checks.removePhoto(task.id, upload.id);            // the user deleted it
const failures = await checks.listFailures(location.id); // every job at a site that did not pass
const names = await checks.classes();                    // what your model can find

Try it in the console first

Every project's Playground page runs your model on a photo in the browser, so you can see what it finds before writing any code.