Versions & Installation
Loading the SDK
Without a pin, ap-entry.js loads its default version, which may not be the newest. To use features marked Needs v5, pin 5.0.0 by adding the following before loading the AutoProctor script:
<script> var apVersionNum = '5.0.0'; </script>
Then add the loader to your page:
<script src="https://cdn.autoproctor.co/ap-entry.js"></script>
ap-entry.js picks the version, adds that version's script and stylesheet to the page, and fires an event when they have loaded:
| Event | Meaning |
|---|---|
apLibReady | The SDK has loaded and window.AutoProctor is defined. Create your instance after this. detail.statusCode is 2005. |
apLibLoadingFailed | The SDK couldn't be loaded (network, ad blocker, firewall). ap-entry.js then shows a browser alert and reloads the page. |
Listen for them before the loader tag:
window.addEventListener('apLibReady', () => {
// window.AutoProctor is ready: create your instance here
})
window.addEventListener('apLibLoadingFailed', () => {
// The SDK couldn't load
})
If the SDK can never load (for example a corporate firewall blocks cdn.autoproctor.co), the reload on apLibLoadingFailed repeats on every load. Allow the CDN on networks you control.
Content Security Policy
If your test page sends a Content-Security-Policy header, it must allow what the SDK loads and calls. This policy covers every feature on these pages; start from it and remove what you don't use:
script-src 'self' https://cdn.autoproctor.co https://cdn.socratease.co 'wasm-unsafe-eval';
style-src 'self' 'unsafe-inline' https://cdn.autoproctor.co https://cdn.socratease.co https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
img-src 'self' data: blob: https://cdn.autoproctor.co https://*.s3.amazonaws.com https://*.s3.us-east-1.amazonaws.com;
media-src 'self' blob: https://*.s3.amazonaws.com https://*.s3.us-east-1.amazonaws.com;
connect-src 'self' https://www.autoproctor.co https://submit.autoproctor.co
https://cdn.autoproctor.co https://*.s3.amazonaws.com
https://*.lambda-url.us-east-1.on.aws https://api.ipify.org
https://*.live-video.net wss://*.live-video.net;
frame-src https://www.youtube.com;
worker-src 'self' blob:;
'wasm-unsafe-eval'is needed for face detection, which is on by default, and for object detection.connect-srccovers AutoProctor's API, test submission, direct evidence uploads to cloud storage, the trust-score and impersonation services, the IP lookup used by multi-session detection, and Amazon IVS for candidate recording.- An inline
<script>that setsapVersionNumor starts AutoProctor is blocked by a strictscript-srcunless you allow it with a nonce or hash, or move it into a file. A blocked pin is silent: you just get the default version. - If you set
assetsBaseUrl, add its origin toscript-src,style-srcandconnect-src. - Roll a new policy out with
Content-Security-Policy-Report-Onlyfirst and check the browser console for blocked requests during a full test.
Self-hosting Assets Needs v5
The SDK downloads some heavy files (models and recording libraries) at runtime, only when the matching feature is on. To serve them from your own server, for example on a network that blocks AutoProctor's CDN, set assetsBaseUrl at the top level of proctoringOptions:
await apInst.setup({
trackingOptions: { numHumans: true },
assetsBaseUrl: 'https://assets.example.com/autoproctor',
})
Copy these files to the same paths under your base URL. You only need the files for features you use.
Path under assetsBaseUrl | Needed for | Copy from |
|---|---|---|
face-detection-tiny-blaze/vision_wasm_internal.js, vision_wasm_internal.wasm, vision_wasm_nosimd_internal.js, vision_wasm_nosimd_internal.wasm, blaze_face_short_range.tflite, tiny_face_detector_model-shard1, tiny_face_detector_model-weights_manifest.json | Face detection, ID card face match | https://cdn.autoproctor.co/ext/face-detection-tiny-blaze/ |
phone-detection/transformers.min.js, ort-wasm-simd-threaded.asyncify.mjs, ort-wasm-simd-threaded.asyncify.wasm, config.json, preprocessor_config.json, model.onnx | Object detection | https://cdn.autoproctor.co/ext/phone-detection/ |
session-rec-all.min.js | Session recording | https://cdn.socratease.co/session-rec-all.min.js |
rrweb-player-2.0.0-alpha.18.min.js, rrweb-player-2.0.0-alpha.18.min.css | Session recording playback in the report. Only loaded from your server when .setup() with assetsBaseUrl ran on the same instance; a report page that only calls .showReport() loads it from AutoProctor's CDN. | https://cdn.autoproctor.co/ext/ |
ivs/amazon-ivs-web-broadcast-1.40.0.js | Candidate recording | https://cdn.autoproctor.co/ext/ivs/ |
Server requirements:
- HTTPS, with CORS allowing your test pages' origin.
- Serve
.wasmasapplication/wasmand.js/.mjsastext/javascript. - The four large object-detection files (
transformers.min.js, bothort-wasm-simd-threaded.asyncify.*files andmodel.onnx) should be served gzip-compressed. - Re-copy the files whenever you change SDK version.
assetsBaseUrl only changes where these files come from. API calls and evidence uploads still go to AutoProctor, and candidate recording still streams to Amazon IVS. ap-entry.js, the SDK script and stylesheet, the report's images, Google Fonts, the how-to video and the auxiliary-device setup image still load from their usual hosts.
Browser Compatibility
AutoProctor works on all modern browsers, even on mobile phones. It runs only on secure pages (https://, or localhost while developing). For a full list of compatible devices and browsers, see our compatibility guide.