Docs / Guides
Add proctoring to a plain HTML quiz
No build step, no framework: one script tag and a few lines of JavaScript. This works for a hand-written quiz page, a WordPress or Webflow page where you can add custom code, or any tool that lets you add a script to the page the candidate takes the test on.
1. Get a page key
Create an account, choose Record or Record + AI review, and add the website your quiz runs on. You get a key that starts with pk_pub_. It is safe in the page: it works only on the websites you list, and on localhost.
2. Add the script and wire it to your page
<button id="start">Start test</button>
<div id="quiz" hidden>
<p id="question"></p>
<button id="next">Next</button>
<button id="submit">Submit</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/proctorkit/dist/proctorkit.global.js"></script>
<script>
// who is taking the test (id and name are required with a key)
const proctor = ProctorKit.createProctor({
key: 'pk_pub_...',
candidate: { id: 'c-1042', name: 'Asha Rao' },
test: { id: 'sales-1', name: 'Sales screening' },
});
const questions = [
{ id: 'Q1', text: 'First question' },
{ id: 'Q2', text: 'Second question' },
];
let i = 0;
function show() {
document.querySelector('#question').textContent = questions[i].text;
// tag everything with the question on screen
proctor.setContext({ questionId: questions[i].id });
}
document.querySelector('#start').onclick = async () => {
// system check and consent
const check = await proctor.runChecks();
if (!check.ok || !proctor.start())
return alert('Could not start: ' + check.reason);
document.querySelector('#start').hidden = true;
document.querySelector('#quiz').hidden = false;
show();
};
document.querySelector('#next').onclick = () => {
if (i < questions.length - 1) {
i++;
show();
}
};
document.querySelector('#submit').onclick = () => {
// releases the camera and screen
proctor.stop();
// ...send the answers wherever you send them today
};
</script>
That is the whole integration. Open the page over HTTPS (or localhost) in desktop Chrome or Edge to try it.
3. See the results
Each candidate appears in your dashboard under their test, with the recording and flags laid out by question.
Good to know
- Pin the version in production:
https://cdn.jsdelivr.net/npm/proctorkit@0.2.0/dist/proctorkit.global.js. - Countdown: use
proctor.activeMs(), which leaves out paused time. - No account: leave out
keyand passonEvent,onClipandonSnapshotto keep everything yourself; see the docs. - Hosted form builders (Google Forms, Microsoft Forms, Typeform) do not let you add scripts to the form, so ProctorKit cannot run inside them. Put the questions on a page you control instead.
Next: the React and Next.js guides, or the full docs.