@byokit/pair has 2,578 recorded weekly downloads on npm.
About @byokit/pair
This package was published as @byokit/link up to 0.8.x. @byokit/link still re-exports it unchanged through
0.8.x and is removed in 0.9.0; new installs use @byokit/pair.
Noise IK over WebSocket (noise-handshake + libsodium; frames sealed by @noble/ciphers), in Node, browsers/PWAs
and React Native. The main entry has no listener, files or environment access: the app hands the host its sockets
and stores. Threat model and review checklist: SECURITY.md.
Host policy and streams are available; relay routing is in @byokit/relay.
Install
npm install @byokit/pair
· Latest release · All releases
Quickstart
npm install @byokit/pair ws
ws is only the WebSocket server for this example; any server works. A host and a device in one file, on loopback:
import { WebSocketServer } from 'ws';
import { DeviceLink, Host, keyPair, pairWithOffer } from '@byokit/pair';
// The computer: it keeps the credentials and answers requests.
const host = await Host.open({
keys: keyPair(), // keep it with hostKeyFile() from '@byokit/pair/node' in a real app
name: 'Kitchen computer',
confirm: ({ name, words }) => { console.log(`host: pair ${name}? it shows "${words}"`); return true; },
handle: (req, device) => ({ echo: req.args, from: device.name }),
});
const wss = new WebSocketServer({ host: '127.0.0.1', port: 7300 });
wss.on('connection', (ws) => host.accept(ws));
// The offer is what the QR code shows.
const { text } = host.compactOffer({ role: 'control', urls: ['ws://127.0.0.1:7300/link'] });
// The phone or browser: scan, compare the words, then ask.
const grant = await pairWithOffer(text, { name: 'Pixel 9', onWords: (w) => console.log(`device: check "${w}"`) });
const link = new DeviceLink(grant, { onStatus: (s) => console.log(`device: ${s}`) });
console.log('answer:', await link.request('say.hello', { text: 'hi' }));
link.stop(); host.close(); wss.close();
Output (the two words differ on every run):
device: check "rose oak"
host: pair Pixel 9? it shows "rose oak"
device: online
answer: { echo: { text: 'hi' }, from: 'Pixel 9' }
API at a glance…
Description from the npm listing.
- typescript
- ai
- ai-sdk
- react-native
- web
- privacy
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm AI SDKs plugins
All 20 @byokit/pair alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@byokit/pair. First seen Oct 26, 2026; last successful collection Oct 26, 2026. See the methodology.