# @m1k1o/neko Framework-free client library for the [neko](https://github.com/m1k1o/neko) v3 API: REST, the `/api/ws` event protocol, the stream through a pluggable transport (WebRTC with its binary input channel, see [Transports](#transports)), and a pluggable control device, with the keyboard/mouse/touch overlay (wheel, file drop, the host's cursor) included (see [Control and input](#control-and-input)). It is what the React GUI in `../src` is built on, and it can drive a neko server from any framework or from a plain page. ESM, TypeScript declarations included; the one runtime dependency is [zustand](https://github.com/pmndrs/zustand) (its vanilla store, ~1 KB), which holds the state. ```sh npm install @m1k1o/neko ``` ## Quick start ```ts import { NekoClient, mount } from '@m1k1o/neko' const client = new NekoClient({ autologin: true, autoconnect: true, autoplay: true }) // state: connection, video, control, screen, sessions, settings (a zustand store: select what you need) client.store.subscribe( (s) => s.connection.status, (status) => render(client.state), ) // one-off happenings, including plugin events (chat/*, filetransfer/*, ...) client.events.on('message', (event, payload) => console.log(event, payload)) // point at a server: resumes a saved session (autologin) or logs in with ?token= in the URL client.setUrl('https://neko.example.com/') // or log in by hand await client.login('name', 'password') client.connect() // the video, with the keyboard/mouse overlay on top (mount() does the two attaches below) const unmount = mount(client, document.getElementById('video')!) ``` The two pieces separately — the stream alone, or with the overlay as a second step: ```ts import { Overlay } from '@m1k1o/neko' const box = document.getElementById('box')! // position: relative, inside the area the video fills const detach = client.transport.attach(box) // the stream: a