{"id":16188623,"url":"https://github.com/konsumer/blink-data","last_synced_at":"2025-07-18T01:37:05.087Z","repository":{"id":36467756,"uuid":"225992539","full_name":"konsumer/blink-data","owner":"konsumer","description":"Interact with blink camera servers in javascript","archived":false,"fork":false,"pushed_at":"2023-01-05T02:21:47.000Z","size":1988,"stargazers_count":3,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T01:29:05.122Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konsumer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-05T01:46:54.000Z","updated_at":"2022-03-11T00:21:45.000Z","dependencies_parsed_at":"2023-01-17T01:45:44.565Z","dependency_job_id":null,"html_url":"https://github.com/konsumer/blink-data","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fblink-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fblink-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fblink-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fblink-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konsumer","download_url":"https://codeload.github.com/konsumer/blink-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244350706,"owners_count":20439285,"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-10T07:28:40.808Z","updated_at":"2025-03-19T03:30:41.532Z","avatar_url":"https://github.com/konsumer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blink-data\n\nInteract with blink camera servers in javascript\n\nThis will allow you to interact with [blink cameras](https://blinkforhome.com/). You can use it in node, electron, or a browser (with CORS security disabled.)\n\n## install\n\n```\nnpm i blink-data\n```\n\n## usage\n\n### basics\n\n```js\nimport { Blink } from 'blink-data'\n\nasync function run () {\n  const blink = new Blink()\n  await blink.login('me@demo.com', 'mypassword')\n\n  // get current user-info\n  const user = await blink.user()\n  console.log(user)\n\n  // get list of current user's networks\n  const networks = await blink.networks()\n  console.log(networks)\n\n  // get details about a network\n  const network = await blink.network(networks[0].id)\n  console.log(network)\n\n  // get a list of videos\n  const videos = await blink.videos()\n  console.log(videos)\n\n  // get details about a camera\n  const camera = await blink.camera(networks[0].network_id, networks[0].cameras[0].id)\n  console.log(camera)\n}\n\nrun()\n```\n\nI haven't setup API-docs yet, but you can see usage examples iun the [unit-test](https://github.com/konsumer/blink-data/blob/master/src/blink-data.test.js).\n\n### browser\n\nYou will need to disable CORS security for this to work directly from blink servers, in a browser:\n\nClose all instances of Chrome browser (open taskmanager and kill any resilient Chrome process). Execute \n\nWindows\n```\nC:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe --disable-web-security --user-data-dir=\u003cpath to viewer\u003e. \n```\nMacOS\n```\nopen -a /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --args --disable-web-security --user-data-dir=\u003cpath to viewer\u003e\n```\n\nYou can also do this in your own electron app:\n\n```js\nconst win = new BrowserWindow({\n  webPreferences: { webSecurity: false }\n})\n```\n\nAlternatively, if you want to do it all in IPC-space, you can:\n\n```js\nconst Blink = require('electron').remote.require('blink-data')\n```\n\nAnd CORS-security should be disabled for just blink.\n\n### rehydrate\n\nIf you are using this on a webserver, or just want to login via a token (instead of email/password), you can rehydrate them to work with their session:\n\n```js\nconst blink = new Blink()\nblink.hydrate (token, account, region)\nblink.user().then(console.log)\n```\n\nYou can get `token`, `account`, and `region` from the output of `blink.login()`, so store this, and send it via a cookie/session/header.\n\n\nHere is a client-side example using `localStorage`:\n```js\n// at login time\nconst blink = new Blink()\nconst { authtoken, account, region } = await blink.login(email, password)\nlocalStorage.user = JSON.stringify({ token: authtoken.authtoken, id: account.id, region: Object.keys(region)[0] })\n\n// later\nconst blink = new Blink()\nconst { token, id, region } = JSON.parse(localStorage.user)\nblink.hydrate(token, id, region)\nblink.user().then(console.log)\n```\n\n## TODO\n\n* Still need to support programs\n* There are a lot of other API endpoints to wrap\n* need to use commandPolling to check for things finishing and resolve/reject when finished\n* need to work out video proxy for `rtsps://`. [this](https://www.npmjs.com/package/node-rtsp-stream) should help.\n* Better cross-platform (browser vs node) binary support for images \u0026 videos\n\n## related\n\n* [Here](https://github.com/konsumer/blink-desktop) is my desktop-client, using electron.\n\n## credit\n\nBig shout-out to [MattTW's BlinkMonitorProtocol](https://github.com/MattTW/BlinkMonitorProtocol/). This is totally generated from that. [bling-viewer](https://github.com/lurume84/bling-viewer) is also great, and helped work out some parts.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fblink-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonsumer%2Fblink-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fblink-data/lists"}