Links Worker
Overview
The links Cloudflare Worker serves two distinct purposes from links.floatme.io (prod) and links.test.floatme.io (test):
-
.well-knownfile hosting — serves Apple App Site Association (AASA) and Google Digital Asset Links files that enable iOS Universal Links and Android App Links respectively. -
Deeplink routing — all other
GETrequests return200 OKwith an empty body (the domain itself acts as the registered Universal Link / App Link domain; iOS and Android intercept the navigation before the browser renders it).
The deeplink redirect to floatme://… is handled natively by the OS (iOS / Android) using the .well-known files this worker serves — the worker does not perform an HTTP redirect to the custom scheme itself.
|
Source
cloudflare/workers/links/
| File | Purpose |
|---|---|
|
Entry point; route matching and |
|
Static JSON payloads for Apple AASA and Google |
|
Worker name, routes, and |
|
Uploads |
Routes
| Method | Path | Description |
|---|---|---|
|
|
Apple AASA file (prod or test payload based on |
|
|
Google Digital Asset Links file (prod or test payload) |
|
|
All other paths return |
non-GET |
|
|
.well-known File Hosting
The static payloads are defined in wellknown.ts and selected at runtime by WORKER_ENV.
Apple App Site Association (apple-app-site-association)
The AASA file enables iOS Universal Links. The worker serves a different payload for prod vs test, referencing different app bundle IDs.
| Environment | App ID |
|---|---|
prod |
|
test |
|
| Pattern | Matches |
|---|---|
|
Any URL under |
|
Any URL under |
The file also declares webcredentials for the same app ID, enabling AutoFill credential association.
Google Digital Asset Links (assetlinks.json)
The assetlinks.json file enables Android App Links.
| Environment | Package name |
|---|---|
prod |
|
test |
|
Both environments share the same SHA-256 certificate fingerprint:
3B:EA:74:F3:95:29:BF:E2:14:9F:9D:87:EB:CE:E3:D5:
FD:8B:AF:21:7E:20:0D:5C:67:5B:14:DB:1D:6E:83:40
The relation declared is delegate_permission/common.handle_all_urls.
Deeplink Routing
links.floatme.io is the registered Universal Link (iOS) and App Link (Android) domain for the FloatMe mobile app.
When the mobile OS opens a URL on this domain, it intercepts the navigation and opens the app directly if installed, without ever making a network request to the worker.
The worker only participates in the initial verification step: iOS and Android download the .well-known files to confirm the domain→app association.
Once verified, all subsequent deeplink navigations are OS-handled.
The supported deeplink path patterns (as declared in the AASA) are:
| URL pattern | Triggered when |
|---|---|
App deeplinks (e.g. shared referral links, in-app feature links) |
|
Login-related deeplinks (e.g. magic link, email verification redirect) |
If the app is not installed, the OS falls back to opening the URL in the browser.
The worker returns 200 OK with an empty body for these paths, so the browser shows a blank page.
A future improvement would be to redirect unarmed deeplinks to the app store.
Environment Variables
| Variable | Kind | Description |
|---|---|---|
|
var |
|
|
secret |
Datadog ingest key for structured log shipping |
Upload secrets with:
make secrets.links.host
Local Development
make links.local
This invokes:
wrangler dev cloudflare/workers/links/index.ts \
-c cloudflare/workers/links/wrangler.toml
No --env flag is passed; wrangler uses the top-level defaults from wrangler.toml (worker name links-local, route localhost/*).
WORKER_ENV is not set in the top-level defaults, so it will be undefined; the worker falls back to the prod payloads (since the === 'test' check is false).
Set WORKER_ENV=test in a .dev.vars file if you need to exercise the test payloads locally.
Wrangler starts a local HTTP server (default port 8787). Example requests:
# Fetch Apple AASA
curl http://localhost:8787/.well-known/apple-app-site-association
# Fetch Google assetlinks
curl http://localhost:8787/.well-known/assetlinks.json
# Deeplink pass-through (returns 200 empty)
curl http://localhost:8787/link/referral/abc123
See Also
-
Architecture —
links.floatme.ioDNS and Cloudflare routing -
Infrastructure — Terraform and wrangler resources for this worker
-
Feature Summary — Deeplinks capability summary
-
Process Flows — Deeplink routing flow end-to-end