INNER CODE UNIT · TypeScript

createEmptySamples

okasi/bot-signal · src/behavioral/index.ts:37

function createEmptySamples(observationMs = 0): Required<BehavioralSamples> {
  return {
    mouseMoves: [],
    scrolls: [],
    keyPresses: [],
    clicks: [],
    touches: [],
    observationMs,
  };
}

/**
 * Creates a detector that observes mouse, wheel, keyboard, click, and touch
 * events on `options.context` (defaults to `globalThis`) and scores how
 * robotic the interaction looks.
 *
 * Call `observe(ms)` for a one-shot observation, or `start()`/`stop()` +
 * `getResult()` to manage the window yourself. Pass `onUpdate` to receive

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…