1
Create a Firebase Project
Go to console.firebase.google.com and sign in with your Google account. Click Add project, give your project a name, and follow the prompts to finish creation. You can disable Google Analytics for the Firebase project — Lynkz tracks its own analytics independently.
2
Enable Firestore
Inside your new project, navigate to Build → Firestore Database in the left sidebar. Click Create database, select your preferred region (choose one close to your users), and when prompted for a security mode select Start in production mode. The default locked-down rules are fine for now — you’ll replace them in the next step.
3
Set Firestore Rules
In the Firestore console, open the Rules tab and replace the existing content with the rules below, then click Publish.These rules allow public reads of page data while blocking clients from writing sensitive fields such as
pinHash and email. Analytics can be written from the browser but never read. Lockout and magic token records are fully server-side only.4
Get Your Web App Config
Navigate to Project Settings (gear icon) → Your apps. If you haven’t added a web app yet, click Add app and choose the Web platform (Copy each value into your
</>). After registering the app, Firebase displays a config object like this:.env.local file under the corresponding NEXT_PUBLIC_FIREBASE_* variable. See the Environment Variables reference for the full list.5
Get Your Service Account Key
Still in Project Settings, open the Service accounts tab. Click Generate new private key and confirm the download. Firebase gives you a
.json file containing your full service account credentials.Open the file, copy its entire contents, and set it as the value of FIREBASE_SERVICE_ACCOUNT_KEY in your Vercel environment variables. The value should be the raw JSON string — the entire object, including braces.