npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

exam-proctor-sdk3

v1.1.5

Published

A Node.js SDK for integrating exam proctoring features(Registration + verification) into your applications.

Readme

exam-proctor-sdk3

Lightweight Express middleware for in-page exam proctoring — no iframes, no sidecars, no separate processes.

npm version


How It Works

exam-proctor-sdk3 mounts directly into your existing Express app as middleware. It handles registration, session verification, and client-side proctoring inside your app's same-origin flow without iframes or a sidecar service.

Your Express App
    └── app.use(examProctor.middleware(config))
            ├── GET  /proctor/register
            ├── GET  /proctor/verify
            ├── GET  /proctor/api/session-token
            └── GET  /proctor/proctor-bundle.js   ← injected client SDK

Install

npm install exam-proctor-sdk3

Quick Start (Developer Guide)

Here's how to integrate the SDK into your Express project and trigger it from your frontend.

1. Server-Side Setup

const express = require('express');
const examProctor = require('exam-proctor-sdk3');

const app = express();

// Mount the middleware
app.use(examProctor.middleware({
  // Optional: Save violations to your own database (MongoDB, Postgres, etc.)
  onViolation: async (violationData) => {
      console.log("New violation received:", violationData);
      // await myDatabase.violations.insert(violationData);
  },
  // Optional: override default violation log directory
  // violationLogDir: './my-violations-folder',
  // See Configuration section for more options
}));

// Inject the config tag and bundle in your HTML response
app.get('/exam', (req, res) => {
  res.send(`
    <html>
      <head>
        ${examProctor.configScriptTag({ /* runtime config */ })}
      </head>
      <body>
        <h1>My Exam Application</h1>
        
        <!-- Inject the proctoring client script -->
        <script src="/proctor/proctor-bundle.js"></script>
        
        <script>
          // Start proctoring when the exam begins
          document.addEventListener('DOMContentLoaded', () => {
             // Ensure you pass a unique session ID and the student's name
             window.ProctoringSystem.start('unique-session-123', 'John Doe');
          });

          // Stop proctoring when the exam is submitted
          function submitExam() {
             window.ProctoringSystem.stop();
          }
        </script>
      </body>
    </html>
  `);
});

app.listen(3000);

2. Client-Side API

Once /proctor/proctor-bundle.js is loaded in the browser, the global ProctoringSystem object is available:

// Start proctoring for a student session
window.ProctoringSystem.start('session-123', 'Student Name');

// Stop proctoring (call on exam submit or timeout)
window.ProctoringSystem.stop();

The system also fires custom events on the window object that you can listen to:

window.addEventListener('examproctor:ready', () => {
    console.log('Proctoring SDK is ready to start');
});

window.addEventListener('examproctor:started', (e) => {
    console.log('Proctoring started for session:', e.detail.sessionId);
});

window.addEventListener('examproctor:violation_limit_exceeded', (e) => {
    console.log('Student exceeded violations. Terminate exam!', e.detail);
});

Exam Flow

/  →  /proctor/register  →  /proctor/verify  →  /exam  →  /result
  1. Student lands on / and is redirected to /proctor/register
  2. After registration, identity is verified at /proctor/verify
  3. On success, student proceeds to /exam
  4. On submit, session ends and student sees /result

Server API

These are exported directly from require('exam-proctor-sdk3'):

| Export | Type | Description | |---|---|---| | middleware(config) | function | Express middleware — mounts all /proctor/* routes into your app | | configScriptTag(config) | function | Returns an inline <script> tag with runtime config for the client | | registerUrl() | function | Returns the registration route path (/proctor/register) | | verifyUrl(sessionId) | function | Returns the verification route path for a given session |


Configuration

The middleware() and configScriptTag() functions accept a config object with the following properties:

| Property | Default | Description | |---|---|---| | modelsBaseUrl | https://cdn.jsdelivr.net/gh/Murali55-09/violation-detect@models-cdn/ | CDN path for YOLO and FaceMesh models. | | yoloModelFile | best_int8rc.onnx | YOLO model filename to use during the exam runtime. | | yoloRequestedInputSize | 640 | Preferred YOLO input size before ONNX metadata auto-adjustment. | | yoloClassThresholds | built-in defaults | Per-class confidence thresholds, e.g. { phone: 0.28, book: 0.35, earbuds: 0.25 }. | | yoloClassIou | built-in defaults | Per-class NMS IoU thresholds, e.g. { phone: 0.45, book: 0.45, earbuds: 0.40 }. | | yoloMotionThreshold | 0 | Motion score needed before object detection runs early. | | yoloObjectForceInterval | 1 | Force YOLO every Nth frame even when motion is low. | | yoloViolationCooldownMs | 3000 | Minimum time between repeated object violations of the same type. | | yoloTrackDecay | 0.70 | Per-frame decay for stale object tracks. | | yoloTrackDrop | 0.25 | Drop threshold for stale object tracks. | | yoloTrackReappearMs | 1200 | Time gap before an object is treated as a new appearance again. | | yoloVisualTtlMs | 450 | How long detected boxes remain visible after the last fresh detection. | | onViolation | null | An async callback function triggered whenever a new violation is detected, allowing you to save it to your own custom database (e.g. MongoDB, Postgres, MySQL). | | violationLogDir | .exam-proctor/violations | Directory on your local server where violation JSON logs will be saved as a local file backup. | | mountPath | /proctor | The base path where proctoring routes are mounted. | | workerPath | /proctor/proctoringWorker.js | Path to the background proctoring worker script. |


AI Features & Model Support

Includes a built-in YOLOv8n model optimized for academic integrity:

  • Class 0: Phone — Detects mobile devices in frame.
  • Class 1: Book/Notes — Detects physical study materials.
  • FaceMesh / MobileFaceNet — 468-point landmark tracking for head-pose (looking away) and identity validation.

Detection models are loaded from CDN by default:

https://cdn.jsdelivr.net/gh/Murali55-09/violation-detect@models-cdn/

Self-hosting: Place model files locally and point to them via your middleware(config) options. Local models in exam-proctor-sdk3/models/* are supported as a fallback for air-gapped or offline environments.


Headers

The SDK expects your Express app to serve pages with the following headers for full browser API access (camera, cross-origin isolation):

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: same-origin

Publish & Release

To publish a new version:

  1. Increment version in package.json (e.g., npm version patch).
  2. Run npm run build to bundle client assets.
  3. Run npm publish --access public (Make sure you are logged in using npm login).

Requirements

  • Node.js >= 18
  • Express >= 4

License

MIT