
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
atv-companion
Advanced tools
TypeScript SDK for Apple TV Companion protocol - scan, pair, and remote control
A TypeScript SDK for Apple TV Companion protocol - scan, pair, and remote control Apple TV devices.
This project is a TypeScript port of the Companion protocol implementation from pyatv.
Code generated by AI (cc)
Original Python code forked from: pyatv by @postlund
npm install atv-companion
# or
pnpm add atv-companion
import { scan } from 'atv-companion';
const devices = await scan({ timeout: 5000 });
console.log(devices);
import {
CompanionConnection,
CompanionProtocol,
CompanionPairSetupProcedure,
} from 'atv-companion';
const connection = new CompanionConnection('192.168.1.100', 49152);
const protocol = new CompanionProtocol(connection);
await connection.connect();
const pairSetup = new CompanionPairSetupProcedure(protocol);
await pairSetup.startPairing();
// Enter the PIN shown on Apple TV screen
const credentials = await pairSetup.finishPairing('1234');
console.log('Credentials:', credentials);
connection.close();
import { CompanionAPI, HidCommand } from 'atv-companion';
const api = new CompanionAPI('192.168.1.100', 49152, credentials);
await api.connect();
// Send button commands
await api.pressButton(HidCommand.Menu);
await api.pressButton(HidCommand.Up);
await api.pressButton(HidCommand.Select);
// Media control
await api.play();
await api.pause();
await api.setVolume(0.5);
// Launch app
await api.launchApp('com.apple.TVWatchList');
await api.disconnect();
| Command | Description |
|---|---|
Up | Navigate up |
Down | Navigate down |
Left | Navigate left |
Right | Navigate right |
Menu | Menu button |
Select | Select/OK button |
Home | Home button |
VolumeUp | Volume up |
VolumeDown | Volume down |
Siri | Activate Siri |
PlayPause | Play/Pause toggle |
Run the examples:
# Scan for devices
pnpm run example:scan
# Pair with Apple TV
ATV_HOST=192.168.1.100 ATV_PIN=1234 pnpm run example:pair
# Remote control
ATV_HOST=192.168.1.100 ATV_CREDENTIALS=<base64> pnpm run example:remote
MIT
Apple TV Companion 协议的 TypeScript SDK - 扫描、配对和远程控制 Apple TV 设备。
本项目是 pyatv 中 Companion 协议实现的 TypeScript 移植版本。
代码由 AI (cc) 生成
原始 Python 代码来自: pyatv by @postlund
npm install atv-companion
# 或
pnpm add atv-companion
import { scan } from 'atv-companion';
const devices = await scan({ timeout: 5000 });
console.log(devices);
import {
CompanionConnection,
CompanionProtocol,
CompanionPairSetupProcedure,
} from 'atv-companion';
const connection = new CompanionConnection('192.168.1.100', 49152);
const protocol = new CompanionProtocol(connection);
await connection.connect();
const pairSetup = new CompanionPairSetupProcedure(protocol);
await pairSetup.startPairing();
// 输入 Apple TV 屏幕上显示的 PIN 码
const credentials = await pairSetup.finishPairing('1234');
console.log('凭证:', credentials);
connection.close();
import { CompanionAPI, HidCommand } from 'atv-companion';
const api = new CompanionAPI('192.168.1.100', 49152, credentials);
await api.connect();
// 发送按钮命令
await api.pressButton(HidCommand.Menu);
await api.pressButton(HidCommand.Up);
await api.pressButton(HidCommand.Select);
// 媒体控制
await api.play();
await api.pause();
await api.setVolume(0.5);
// 启动应用
await api.launchApp('com.apple.TVWatchList');
await api.disconnect();
| 命令 | 描述 |
|---|---|
Up | 向上导航 |
Down | 向下导航 |
Left | 向左导航 |
Right | 向右导航 |
Menu | 菜单按钮 |
Select | 选择/确认按钮 |
Home | 主页按钮 |
VolumeUp | 音量增加 |
VolumeDown | 音量减少 |
Siri | 激活 Siri |
PlayPause | 播放/暂停切换 |
运行示例:
# 扫描设备
pnpm run example:scan
# 与 Apple TV 配对
ATV_HOST=192.168.1.100 ATV_PIN=1234 pnpm run example:pair
# 遥控器控制
ATV_HOST=192.168.1.100 ATV_CREDENTIALS=<base64> pnpm run example:remote
MIT
FAQs
TypeScript SDK for Apple TV Companion protocol - scan, pair, and remote control
The npm package atv-companion receives a total of 10 weekly downloads. As such, atv-companion popularity was classified as not popular.
We found that atv-companion demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.