{"id":47512,"library":"eufy-security-ws","title":"eufy-security-ws","description":"A Node.js WebSocket server that wraps the eufy-security-client library, providing programmatic access to Eufy Security devices (cameras, doorbells, locks, sensors). Version 2.1.0 requires Node >=20.0.0 and uses CJS modules. It exposes a WebSocket API for controlling and receiving events from Eufy devices, designed for integration into custom smart home systems. The project is community-maintained and not affiliated with Anker/Eufy.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/bropat/eufy-security-ws","tags":["javascript","eufy","eufycam","cam","cameras","security","eufy-security","doorbell","lock"],"install":[{"cmd":"npm install eufy-security-ws","lang":"bash","label":"npm"},{"cmd":"yarn add eufy-security-ws","lang":"bash","label":"yarn"},{"cmd":"pnpm add eufy-security-ws","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library for communicating with Eufy Security devices","package":"eufy-security-client","optional":false}],"imports":[{"note":"Package uses CommonJS. ESM imports are not supported.","wrong":"import EufySecurityWS from 'eufy-security-ws';","symbol":"default","correct":"const EufySecurityWS = require('eufy-security-ws');"}],"quickstart":{"code":"const EufySecurityWS = require('eufy-security-ws');\nconst server = new EufySecurityWS({\n  port: 3000,\n  psk: process.env.PSK ?? 'my-secret-psk',\n});\nserver.start().then(() => {\n  console.log('WebSocket server started on ws://localhost:3000');\n}).catch(err => console.error(err));\n\n// On another WebSocket client, connect and authenticate:\n// ws://localhost:3000?psk=my-secret-psk\n// Then send a JSON command like:\n// {\"messageId\":\"1\",\"command\":\"login\",\"data\":{\"username\":\"...\",\"password\":\"...\"}}\n// See full API docs at https://bropat.github.io/eufy-security-ws/","lang":"javascript","description":"Shows how to instantiate the WebSocket server with a pre-shared key, start it, and how a client connects and sends a login command."},"warnings":[{"fix":"Use `const EufySecurityWS = require('eufy-security-ws');` instead of `import`.","message":"The package is CJS-only — do not use ESM `import` syntax.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a reverse proxy like nginx to terminate TLS and forward to the WS server.","message":"Secure WebSocket (wss) is not supported natively — must be proxied via HTTPS.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace `psk` with `authentication: (request) => request.url.searchParams.get('psk') === 'my-secret-psk'`.","message":"The `psk` property in the constructor options is deprecated; use `authentication` with a token callback.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Upgrade Node.js to v20 or later.","message":"Node.js >=20.0.0 required – earlier versions not supported.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.1.0':29 '20.0.0':32 'access':19 'affili':66 'anker/eufy':68 'api':41 'cam':72 'camera':24,73 'cjs':35 'client':15 'communiti':62 'community-maintain':61 'control':43 'custom':54 'design':50 'devic':23,49 'doorbel':25,78 'eufi':2,13,21,48,70,76 'eufy-secur':75 'eufy-security-cli':12 'eufy-security-w':1 'eufycam':71 'event':46 'expos':38 'home':56 'integr':52 'javascript':69 'librari':16 'lock':26,79 'maintain':63 'modul':36 'node':31 'node.js':6 'programmat':18 'project':59 'provid':17 'receiv':45 'requir':30 'secur':3,14,22,74,77 'sensor':27 'server':8 'smart':55 'system':57 'use':34 'version':28 'websocket':7,40 'wrap':10 'ws':4","created_at":"2026-06-07T16:51:54.067243+00:00","updated_at":"2026-06-07T16:51:54.067243+00:00","problems":[{"fix":"Kill the process using the port or change port in options.","cause":"Port already in use by another server or previous instance.","error":"Error: listen EADDRINUSE :::3000"},{"fix":"Provide a string PSK via options.psk or switch to authentication callback.","cause":"Missing or invalid pre-shared key when using deprecated psk option.","error":"Error: PSK must be a string"},{"fix":"Use `require` instead of `import`.","cause":"Using ESM import on a CJS-only module.","error":"TypeError: EufySecurityWS is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/bropat/eufy-security-ws#readme","github":"https://github.com/bropat/eufy-security-ws","docs":null,"changelog":null,"pypi":null,"npm":"eufy-security-ws","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}