Skip to main content

Firebase Hosting

Spark (free) is enough — no App Hosting / Blaze required.

Live example: https://fir-email-link-host.web.app
(also fir-email-link-host.firebaseapp.com)

CheckLive URL
Landingfir-email-link-host.web.app
Android App Links/.well-known/assetlinks.json
iOS AASA/.well-known/apple-app-site-association

Customize for your app

FileChange?What to put
.firebasercYesYour Firebase project ID under projects.default
firebase.jsonRarelyAlready points publicout and sets JSON headers for .well-known. Leave unless you add custom redirects
config/site.jsonYesYour brand, copy, theme
.envYesPackage name, SHA-256, iOS Team/Bundle ID, store URLs

.firebaserc example

{
"projects": {
"default": "your-firebase-project-id"
}
}

.env example (build-time)

NEXT_PUBLIC_ANDROID_STORE_URL="https://play.google.com/store/apps/details?id=com.yourcompany.yourapp"
NEXT_PUBLIC_IOS_STORE_URL="https://apps.apple.com/app/id1234567890"

ANDROID_PACKAGE_NAME="com.yourcompany.yourapp"
ANDROID_SHA256_CERT_FINGERPRINTS="AA:BB:CC:DD:..."

IOS_TEAM_ID="ABCDE12345"
IOS_BUNDLE_ID="com.yourcompany.yourapp"
# /__/auth/links* is prepended by default for Firebase email links

Association files are generated during bun run build (prebuildgenerate:well-known). Empty IOS_TEAM_ID / IOS_BUNDLE_ID produces an AASA with empty details.

Deploy

cp .env.example .env
# edit .env + config/site.json + .firebaserc

bun install
bun run build
bunx firebase-tools@latest deploy --only hosting --project your-firebase-project-id

Live site: https://fir-email-link-host.web.app (or your custom domain attached in the Firebase console).

CI / GitHub Actions tip

Store association and NEXT_PUBLIC_* values as repository secrets/variables and write them into .env (or export them) before bun run build. Firebase Hosting only uploads out/ — it does not re-read .env at serve time.

Verify

Against the live demo:

curl -sS https://fir-email-link-host.web.app/.well-known/assetlinks.json
curl -sSI https://fir-email-link-host.web.app/.well-known/apple-app-site-association

Against your own deploy, swap the host for https://YOUR_SITE.web.app (or your custom domain).

Expect Content-Type: application/json and Content-Disposition: inline (configured in firebase.json).