Skip to content
Sellzy

Social sign-in

Add Google and Facebook sign-in with Firebase.

Email sign-in always works. Firebase adds Google and Facebook buttons to the storefront and admin. Without Firebase, the buttons show a friendly “isn’t set up yet” message.

1. Create a Firebase project

  1. Open console.firebase.google.com and create a project.
  2. Authentication → Sign-in method: enable Google. For Facebook, add your Facebook app ID and secret from developers.facebook.com.
  3. Authentication → Settings → Authorized domains: add your live storefront and admin domains (localhost is there already).

2. Web config (storefront and admin)

Project settings → Your apps → Web app. Copy the config values:

# apps/web/.env
NEXT_PUBLIC_FIREBASE_API_KEY=...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=...
NEXT_PUBLIC_FIREBASE_APP_ID=...

# apps/admin/.env: the same values with the VITE_ prefix
VITE_FIREBASE_API_KEY=...

3. Service account (API)

Project settings → Service accounts → Generate new private key. Paste the whole JSON on one line, in single quotes:

# apps/api/.env
FIREBASE_SERVICE_ACCOUNT='{"type":"service_account","project_id":"..."}'

The API verifies every social sign-in with this key before creating a session.

Stuck? Run pnpm check:setup, check Troubleshooting, or contact support.