This implementation currently only supports 36H11 family and is under active developement so it is not recommended for production usage.
A working demo is available here : demo
AprilTagJS depends on opencv.js, so first you need to include it in your project. (Latest nightly builds are available here : opencv.js
let mat = cv.imread(imgSource);
detect(mat, (detections) => {
detections.forEach((detection) => {
console.log(detection.id);
console.log(detection.hammingDistance);
console.log(detection.points);
});
});