Better Auth plugin

better-auth-cross-device

Start an approval on one device, complete it on another, and return the result to the original Better Auth session.
pnpm add @onmax/better-auth-cross-device

The plugin owns the short-lived order, device-role tokens, endpoint wiring, and lifecycle checks. Your adapter owns the proof format.

What you get


icon: i-lucide-server title: Server plugin


Adds Better Auth endpoints, a dedicated order model, lifecycle validation, and session finalization for approved login orders.


icon: i-lucide-monitor-smartphone title: Client helpers


Starts orders, opens claim URLs, subscribes to events, and finalizes the approved result from the initiating device.


icon: i-lucide-key-round title: Proof adapters


Lets you verify passkeys, wallet signatures, or app-specific approvals without changing the order lifecycle.


icon: i-lucide-radio title: Live status


Uses server-sent events so the initiating device can react when the approving device claims, approves, rejects, or expires the order.

How it works

StepDeviceWhat happens
1Initiating deviceStarts an order and shows the claim URL as a link or QR code.
2Approving deviceClaims the order and receives a challenge token.
3Approving deviceReads the challenge and submits adapter-specific proof.
4ServerVerifies the proof through your adapter and marks the order approved.
5Initiating deviceReceives the event and finalizes the result.
Orders are intentionally short-lived. The default TTL is 120 seconds, and each device role gets a separate token.

Start here

Copyright © 2026