Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.65 KB

README.md

File metadata and controls

57 lines (37 loc) · 1.65 KB

With Firebase

This is a simple set up for Firebase for client side applications.

The firebase app is initialized in firebase/clientApp.js, to use you just have to import it anywhere in the app

The React Context API is used to provide user state.

Deploy your own

Deploy the example using ZEIT Now:

Deploy with ZEIT Now

How to use

Using create-next-app

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-firebase with-firebase-app
# or
yarn create next-app --example with-firebase with-firebase-app

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase
cd with-firebase

Configuration

  1. Create a Firebase project and add a new app to it.
  2. Create a .env file and copy the contents of .env.example into it:
cp .env.example .env
  1. Set each variable on .env with your Firebase Configuration (found in "Project settings").

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Deploy it to the cloud with ZEIT Now (Documentation).