@0xsarwagya/handoff
v0.1.0
Published
Move application state between devices without an account or cloud sync.
Maintainers
Readme
Handoff
Move application state between devices without an account or cloud sync.
A TypeScript library for the moment something is here and should be there — once. The state becomes a self-contained URL artifact; show it as a QR code or send the link. No account, no sync engine, no Handoff server.
Transfer is not sync.
Install
pnpm add @0xsarwagya/handoffThe whole API
On the device that has the state:
import { createHandoff } from "@0xsarwagya/handoff";
const handoff = createHandoff({ receiveUrl: "https://app.example/receive" });
const offer = await handoff.create({ type: "draft", text: "finish on my phone" });
offer.url; // https://app.example/receive#handoff=ho1_…
offer.artifact; // render this as a QR code
offer.qrFriendly; // true while it will actually scanOn the device that wants it:
const state = await handoff.receive(); // reads the current locationThe whole artifact is the capability: anyone with the complete link or QR payload can receive its contents. Treat it like the state itself.
Status
Experimental. The v1 wire protocol is versioned and pinned by test vectors; inline transfer is proven across Chromium, Firefox, and WebKit in CI. Physical-device QR testing is tracked in the compatibility docs.
Documentation
https://oss.sarwagya.wtf/handoff/docs
