{"id":17118389,"url":"https://github.com/axelpale/tet-node-client","last_synced_at":"2025-03-24T01:44:51.016Z","repository":{"id":31471006,"uuid":"35035039","full_name":"axelpale/tet-node-client","owner":"axelpale","description":"Node.js client for The Eye Tribe","archived":false,"fork":false,"pushed_at":"2015-06-16T14:07:27.000Z","size":196,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T08:25:58.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axelpale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-04T13:01:47.000Z","updated_at":"2016-05-01T10:06:20.000Z","dependencies_parsed_at":"2022-09-22T17:52:11.926Z","dependency_job_id":null,"html_url":"https://github.com/axelpale/tet-node-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpale%2Ftet-node-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpale%2Ftet-node-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpale%2Ftet-node-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpale%2Ftet-node-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelpale","download_url":"https://codeload.github.com/axelpale/tet-node-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195909,"owners_count":20575936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:54:28.609Z","updated_at":"2025-03-24T01:44:50.996Z","avatar_url":"https://github.com/axelpale.png","language":"JavaScript","readme":"# tet-node-client\n\nA Node.js client for The Eye Tribe eye-tracker.\n\n\n\n# Install (Not yet)\n\n    $ npm install eyetribe-client\n\n\n\n# Usage\n\n    var EyeTribeClient = require('eyetribe-client');\n    var eye = new EyeTribeClient();\n\n    eye.activate({\n      host: 'localhost',\n      port: 6555,\n      mode: 'push',\n      version: 1\n    });\n\n    eye.on('gazeUpdate', function (x, y) {\n      // do cool stuff\n    });\n\n    eye.on('connected', function () {\n      // connected to tracker server\n    });\n\n    eye.on('disconnected', function (err) {\n      // err not null if disconnected because of an error.\n    });\n\nGet tracker state values asynchronously:\n\n    eye.activate({...}, function (err) {\n      if (err) { console.error('Connection failed.'); return; }\n\n      eye.getScreen(function (err, screen) {\n        if (err) { console.error(err); return; }\n\n        console.log(screen.index); // 1\n        console.log(screen.resolution.width); // 1920 (px)\n        console.log(screen.resolution.height); // 1080\n        console.log(screen.physical.width); // 0.29 (m)\n        console.log(screen.physical.height); // 0.18\n      });\n    });\n\n\n\n# Calibration (Not yet)\n\n    eye.calibrate({\n      numPoints: 20,\n      beforePoint: function (err, index, start, abort) {\n        // Here, decide the point location and draw a point to focus to.\n        ...\n\n        // Tell tracker the point location and start measuring.\n        setTimeout(function () {\n          start(x, y);\n        }, 1000);\n      },\n      startPoint: function (err, index, end, abort) {\n        // Determine how long the measuring lasts and do possible some\n        // graphical effects to keep eyes fixed to the point.\n        ...\n\n        // Tell tracker to end measuring.\n        setTimeout(function () {\n          end();\n        }, 1000);\n      },\n      afterPoint: function (err, index, then, abort) {\n        // Here, remove the old point\n        ...\n\n        // Begin a new measure or jump to results if was last.\n        setTimeout(then, 1000);\n      },\n      afterCalibration: function (err, calibrationResults) {\n\n      }\n    });\n\n\n\n# API\n\n## EyeTribeClient()\n\n    var eye = new EyeTribeClient();\n\n\n### .activate([options], [onConnectedCb(err)])\n\n    eye.activate({ mode: 'pull'}, function (err) {\n      if (err) {\n        console.error('Tracker could not be activated.');\n      }\n      else {\n        console.log('Tracker activated.');\n      }\n    });\n\nOptions are optional, defaults are:\n\n    {\n      host: 'localhost',\n      port: 6555,\n      mode: 'push',\n      version: 1\n    }\n\nThe optional callback `onConnectedCb(err)` will be called once. If activation has been successful `err` is `null`.\n\n\n### .deactivate([onDisconnectedCb()])\n\n    eye.deactivate(function () {\n      // Tracker deactivated\n    });\n\nSucceeds always.\n\n\n### .getFrameRate(callback(err, framerate))\n\n    eye.getFrameRate(function (err, framerate)) {\n      // framerate, number, e.g. 30\n    });\n\n\n### .getLastCalibrationResult(callback(err, calib))\n\n    eye.getLastCalibrationResult(function (err, calib)) {\n      // calib.result, bool, was calibration successful\n      // calib.deg, number, average error in degrees\n    });\n\nFor full list of available properties, see [Eye Tribe Documentation](http://dev.theeyetribe.com/api/#cat_calib).\n\n\n### .getScreen(callback(err, screen))\n\n    eye.getScreen(function (err, screen) {\n      //\n    });\n\nAn example screen object\n\n    {\n      index: 1,\n      resolution: {\n        width: 1440,\n        height: 900\n      },\n      physical: {\n        width: 290,\n        height: 180\n      }\n    }\n\n\n### .getTrackerState(callback(err, stateInteger))\n\n    eye.getTrackerState(function (err, state) {\n      // 0 = tracker device is connected\n      // 1 = tracker device is not connected\n      // 2 = tracker connected but has unsupported unsupported firmware\n      // 3 = tracker connected via insufficient USB connection\n      // 4 = tracker detected but data cannot be transmitted\n    });\n\n\n### .isActivated()\n\n    if (eye.isActivated()) {\n      // Tracker is active.\n    }\n\n\n\n# Run tests\n\n    $ npm run test\n\n\n\n# Versioning\n\n[Semantic Versioning 2.0.0](http://semver.org/)\n\n\n\n# License\n\n[MIT License](../blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelpale%2Ftet-node-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelpale%2Ftet-node-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelpale%2Ftet-node-client/lists"}