Skip to content

0xsarwagya/handoff

Repository files navigation

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/handoff

The 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 scan

On the device that wants it:

const state = await handoff.receive(); // reads the current location

The whole artifact is the capability: anyone with the complete link or QR payload can receive its contents. Treat it like the state itself.

Used in Local

Local uses Handoff to move the WebRTC offer/answer bootstrap between two browsers as a QR code (or a link). Handoff carries the connection state only; the messages themselves flow directly peer-to-peer once the ceremony completes. No signaling server in the middle.

Source: github.com/0xsarwagya/local

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

License

MIT

About

Move application state between devices without an account or cloud sync.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors