firebase-nextjs-example

An example app for using firebase with Next.js

Stars
19

Firebase Next.js Example

A simple example of how to connect to a Firebase database and retrieve data.

Installation

  1. Install Node dependencies:
# with NPM
npm install

# with Yarn
yarn
  1. Create a .env file and a .env.production file in the project root with the following structure:
FIREBASE_API_KEY=ASndKBULjahs57AdnaiAasd2asKD234HBJKHasd
FIREBASE_AUTH_DOMAIN=my-app.firebaseapp.com
FIREBASE_DATABASE_URL=https://my-app.firebaseio.com
FIREBASE_PROJECT_ID=my-app
FIREBASE_STORAGE_BUCKET=my-app.appspot.com
FIREBASE_SENDER_ID=987678767878
  1. Run the app:
# with NPM
npm run dev

# with Yarn
yarn dev