{"id":18726014,"url":"https://github.com/badisi/samsung-tv-remote","last_synced_at":"2025-09-25T10:28:00.239Z","repository":{"id":52547117,"uuid":"89575385","full_name":"Badisi/samsung-tv-remote","owner":"Badisi","description":"📺 NodeJS module to remotely control Samsung SmartTV starting from 2016","archived":false,"fork":false,"pushed_at":"2024-04-12T19:30:03.000Z","size":73,"stargazers_count":43,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-20T18:37:55.619Z","etag":null,"topics":["nodejs","remote-control","samsung","smarttv"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Badisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-27T08:35:58.000Z","updated_at":"2024-07-09T23:20:17.530Z","dependencies_parsed_at":"2022-08-28T00:12:29.820Z","dependency_job_id":"dad78f68-df10-436f-bd7f-907f6a47bdd7","html_url":"https://github.com/Badisi/samsung-tv-remote","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fsamsung-tv-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fsamsung-tv-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fsamsung-tv-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fsamsung-tv-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Badisi","download_url":"https://codeload.github.com/Badisi/samsung-tv-remote/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"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":["nodejs","remote-control","samsung","smarttv"],"created_at":"2024-11-07T14:12:53.110Z","updated_at":"2025-09-25T10:28:00.233Z","avatar_url":"https://github.com/Badisi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    samsung-tv-remote\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ci\u003e📺 NodeJS module to remotely control Samsung SmartTV starting from 2016.\u003c/i\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/samsung-tv-remote\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/v/samsung-tv-remote.svg?color=blue\u0026logo=npm\" alt=\"npm version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://npmcharts.com/compare/samsung-tv-remote?minimal=true\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/dw/samsung-tv-remote.svg?color=7986CB\u0026logo=npm\" alt=\"npm donwloads\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/badisi/samsung-tv-remote/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/l/samsung-tv-remote.svg?color=ff69b4\" alt=\"license\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/badisi/samsung-tv-remote/blob/main/CONTRIBUTING.md#-submitting-a-pull-request-pr\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n## Features\n\n✅ Support **Samsung SmartTV** from `2016+`\u003cbr/\u003e\n✅ Wake TV from sleep mode thanks to `Wake-on-LAN (WoL)`\u003cbr/\u003e\n✅ Send `one` or `multiple` keys at once to the TV\u003cbr/\u003e\n✅ [`241`](https://github.com/badisi/samsung-tv-remote/blob/main/src/keys.ts) known keys already predefined\u003cbr/\u003e\n✅ Works as a library and as a cli tool\u003cbr/\u003e\n\n\n## Installation\n\n```sh\nnpm install samsung-tv-remote --save\n```\n\n```sh\nyarn add samsung-tv-remote\n```\n\n## Usage as cli\n\n```sh\nnpx samsung-tv-remote\n```\n\n## Usage as a library\n\n__Example__\n\n```ts\n/** CommonJS */\n// const { SamsungTvRemote, Keys } = require('samsung-tv-remote');\n\n/** ESM / Typescript */\nimport { SamsungTvRemote, Keys } from 'samsung-tv-remote';\n\nconst main = async () =\u003e {\n    const remote = new SamsungTvRemote({\n        ip: '192.168.1.111',\n        mac: 'fc:03:9f:0d:72:37'\n    });\n    await remote.wakeTV();\n    await remote.sendKey(Keys.KEY_DOWN);\n    await remote.sendKeys([Keys.KEY_POWER]);\n};\nmain().catch(console.error);\n```\n\n__Options__\n\n```ts\ninterface SamsungTvRemoteOptions {\n    /**\n     * IP address of the TV.\n     */\n    ip: string;\n\n    /**\n     * MAC address of the TV.\n     * Required only when using the 'wakeTV()' api.\n     *\n     * @default 00:00:00:00:00:00\n     */\n    mac?: string,\n\n    /**\n     * Name under which the TV will recognize your program.\n     * - It will be displayed on TV, the first time you run your program, as a 'device' trying to connect.\n     * - It will also be used by this library to persist a token on the operating system running your program,\n     *   so that no further consent are asked by the TV after the first run.\n     *\n     * @default SamsungTvRemote\n     */\n    name?: string,\n\n    /**\n     * Port address used for remote control emulation protocol.\n     * Different ports are used in different TV models.\n     * It could be: 55000 (legacy), 8001 (2016+) or 8002 (2018+).\n     *\n     * @default 8002\n     */\n    port?: number,\n\n    /**\n     * Milliseconds before the connection to the TV times out.\n     *\n     * @default 1000\n     */\n    timeout?: number;\n\n    /**\n     * Enables more detailed output.\n     *\n     * @default false\n     */\n    debug?: boolean;\n}\n```\n\n__Apis__\n\n```ts\nclass SamsungTvRemote {\n    /**\n     * Turn the TV on or awaken it from sleep mode (also called WoL - Wake-on-LAN).\n     * The mac address option is required in this case.\n     */\n    wakeTV(): Promise\u003cvoid\u003e;\n\n    /**\n     * Send a key to the TV.\n     */\n    sendKey(key: Keys): Promise\u003cvoid\u003e;\n\n    /**\n     * Send multiple keys to the TV.\n     */\n    sendKeys(key: Keys[]): Promise\u003cvoid\u003e;\n}\n```\n\n\n## FAQ\n\n### I'm getting a `TypeError: bufferUtil.mask is not a function`\n\nUnder the hood, this library is using [ws](https://github.com/websockets/ws) package and also [bufferutil](https://github.com/websockets/bufferutil) to enhance ws' performances.\n\nSince `bufferutil` is a binary addon, it may or may not be installed correctly on your current platform due to potential incompatibilities.\n\nIn such cases, using the environment variable `WS_NO_BUFFER_UTIL=1` will be necessary to resolve the issue.\n\nYou can read more [here](https://github.com/websockets/ws/blob/master/doc/ws.md#ws_no_buffer_util).\n\n\n## Development\n\nSee the [developer docs][developer].\n\n\n## Contributing\n\n#### \u003e Want to Help ?\n\nWant to file a bug, contribute some code or improve documentation ? Excellent!\n\nBut please read up first on the guidelines for [contributing][contributing], and learn about submission process, coding rules and more.\n\n#### \u003e Code of Conduct\n\nPlease read and follow the [Code of Conduct][codeofconduct] and help me keep this project open and inclusive.\n\n\n\n\n[clipreview]: https://github.com/badisi/samsung-tv-remote/blob/main/cli_preview.png\n[developer]: https://github.com/badisi/samsung-tv-remote/blob/main/DEVELOPER.md\n[contributing]: https://github.com/badisi/samsung-tv-remote/blob/main/CONTRIBUTING.md\n[codeofconduct]: https://github.com/badisi/samsung-tv-remote/blob/main/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadisi%2Fsamsung-tv-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadisi%2Fsamsung-tv-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadisi%2Fsamsung-tv-remote/lists"}