Skip to main content

Module magic_link

Module magic_link 

Source
Expand description

Magic link — encode/decode a ConnectionIdentifier as a shareable link for email/text/web onboarding. A single connection payload can travel three interchangeable ways, all decoded by from_link:

  1. A custom-scheme deep link (web+qualia://connect?p=<payload>) that opens the app directly.
  2. A domain-hosted HTTPS fallback (https://<domain>/w#<payload>) — a normal link that works in any browser and, on a device with the app registered, hands off to it. The payload rides in the URL # fragment so it is never sent to the hosting server (fragments are client-only).
  3. A bare qcx1_… string (paste-anywhere).

The payload in every form is the self-certifying qcx1_<base64url> from ConnectionIdentifier::encode; recipients verify it locally, so the link carries no trust in the transport. base64url is already URL-safe, but we percent-decode defensively on the way in.

Constants§

SCHEME
Custom URL scheme registered by the app for deep links.

Functions§

from_link
Decode a ConnectionIdentifier from ANY supported link form:
to_deep_link
Build a custom-scheme deep link that opens the app directly: web+qualia://connect?p=<id.encode()?>.
to_https_link
Build a domain-hosted HTTPS fallback link: https://<domain>/w#<id.encode()?>.
to_mailto
Build a mailto: URI that pre-fills an onboarding email: a short human line plus the deep link in the body. Both subject and body are percent-encoded.