Welcome to the Think Proctor SDK. This SDK helps you conduct examinations with automated proctoring to prevent users from cheating.
The SDK tracks user activities and the environment using the camera, microphone, and screen, and takes appropriate actions based on recorded violations. A user's credibility score is calculated from recorded violations and can be viewed in the final report.
Include the SDK using a script tag in your HTML file:
<script src="{{Your End Point}}/ThinkProctor/thinkproc.umd.min.js"></script>Copy
ThinkProctor.init() initializes and starts a proctoring session, establishing a connection with the Think Proctor service.
ThinkProctor.init(configurationOptions)
.then(function (session) {
console.log(session.sessionToken);
console.log(session.sessionId);
console.log(session.instanceId);
})
.catch(function(error){
console.log("Initialization Error", error);
});Copy
let configurationOptions = {
api_key: "YOUR_API_KEY",
sdk_token: "SDK_JWT_TOKEN_HERE",
unique_user_id: "myuser123",
user_name: "My User",
group_code: "mygroup123",
group_name: "My Group 123",
template_code: "think_1723213123",
// Optional parameters
language: "en",
camera: {
camera_drag: 1,
camera_position: 'topLeft',
camera_width: 200,
}
};Copy
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your API key from dashboard. |
sdk_token | String | Yes | JWT created using API secret. |
unique_user_id | String | Yes | Unique candidate identifier. |
template_code | String | Yes | Proctoring template ID. |
language | String | No | UI language (default: en). |
registration_id_url | String | No | URL of candidate's ID image. |
time_zone | String | No | Timezone (e.g., "UTC+5:30"). |
camera_width | Number | No | Width of bubble (pixels). |
init() contains sessionToken, sessionId, and instanceId. Store the sessionToken if you need to resume a session later.The sdk_token is a JWT generated on your server and signed using your Think Proctor API secret. It should include api_key, uuid, and group_code.
const jwt = require('jsonwebtoken');
const api_key = "YOUR_API_KEY";
const apiSecret = "YOUR_API_SECRET";
const tokenPayload = {
api_key: api_key,
uuid: "myuser123",
group_code: "mygroup123"
};
const sdk_token = jwt.sign(tokenPayload, apiSecret, {
algorithm: 'HS256',
expiresIn: '2h'
});Copy
| Error Code | Description |
|---|---|
4301 | Invalid api_key or token. |
4302 | Invalid sdk_token. |
4303 | Invalid template_code. |
4308 | Session not found in case of resumes. |
6001 | Session already completed. |
Listen to proctoring events using ThinkProctor.on(event, callback).
| Event Name | Description |
|---|---|
close-application | User clicked Close button. |
suspend-session | Session suspended by AI/Proctor. |
terminate-session | Session terminated by AI/Proctor. |
camera-revoke | Camera access was revoked by user. |
network-restore | Network connection is stable again. |
Run ThinkProctor.checkCompatibility() to ensure the user's environment meets proctoring requirements.
ThinkProctor.checkCompatibility().then(() => {
// Safe to start the exam
let sessionController = ThinkProctor.start();
});Copy
The ThinkProctor.start() method returns a SessionController instance.
| Method | Description |
|---|---|
complete() | Ends monitoring and concludes the session. |
pause() | Temporarily stops monitoring (for breaks). |
play() | Resumes monitoring after a pause. |
The SDK allows pausing and resuming the proctoring session triggers during exam breaks.
// To pause capturing violations
sessionController.pause();
// To resume capturing
sessionController.play();Copy
play/pause functions also trigger their respective events if you have listeners attached.A simple boilerplate for common integration scenario.
<script src="thinkproc.umd.min.js"></script>
<script>
ThinkProctor.init({
api_key: "YOUR_API_KEY",
sdk_token: "JWT_HERE",
unique_user_id: "userX",
user_name: "Adam G",
template_code: "think_123"
}).then(session => {
ThinkProctor.checkCompatibility().then(() => {
const controller = ThinkProctor.start();
// Use controller.complete() as needed
});
});
</script>Copy
The SDK supports multiple languages. Set during init() via the language parameter.
We officially support the latest versions of major browsers:
| Browser | Status | Version |
|---|---|---|
| Google Chrome | Full Support | 80+ |
| Microsoft Edge | Full Support | Latest |
| Mozilla Firefox | Full Support | 70+ |
| Apple Safari | Partial | 13.1+ |