Berry React
v4.0.0
v4.0.0
  • Introduction
  • Package
  • Getting Started
    • Pre-requisites
    • Quick Start
    • Mock backend
    • Deployment
    • Licensing
  • Setup
    • Seed
    • To Existing Project
  • Folder Structure
  • State Management
  • Multi Language
  • Authentication
    • Firebase
    • Auth0
    • AWS Cognito
    • Supabase
  • API Calls
  • Routing
    • New Menu
    • Login as First Page
    • Skip Login
    • Render Menu from the backend
    • Remove menu render via backend
  • Theme
    • Configuration
    • Presets
    • Style
      • Color
      • Typography
      • Overrides
      • Shadows
    • Layouts
    • Logo
  • How to
    • Remove eslint
    • Remove prettier
  • Components
    • Avatar
    • AnimateButton
    • Accordion
    • Breadcrumbs
    • Chip
    • ImageList
    • MainCard
    • Transitions
    • SubCard
  • Dependencies
  • Support
    • Roadmap
    • Changelog
    • FAQ
  • Berry Eco System
Powered by GitBook
On this page

Was this helpful?

  1. Authentication

Firebase

Last updated 3 months ago

Was this helpful?

At present, firebase uses you need to set a secret in the following file. For more detail refer to Firebase here:

  1. Set Firebase Config in .env

.env
VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=
  1. Change AuthProvider

src\App.tsx
// Replace at line 17
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change auth Hooks

    1. Comment another context in the following file and uncomment the Firebase one.

src\hooks\useAuth.ts
import AuthContext from 'contexts/FirebaseContext';
  1. Change Auth Login Method

src/config.ts
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;

At present, firebase uses you need to set a secret in the following file. For more detail refer to Firebase here:

  1. Set Firebase Config in .env

.env
VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=
  1. Change AuthProvider

src\App.jsx
// Replace at line 17
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change auth Hooks

    1. Comment another context in the following file and uncomment the Firebase one.

src\hooks\useAuth.js
import AuthContext from 'contexts/FirebaseContext';
  1. Change Auth Login Method

src/config.js
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;
  1. Set Firebase Config in .env

.env
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
  1. Change AuthProvider

src/store/ProviderWrapper.tsx
// Replace at line 27
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change auth Hooks

    1. Comment another context in the following file and uncomment the Firebase one.

src\hooks\useAuth.ts
import AuthContext from 'contexts/FirebaseContext';
  1. Change Auth Login Method

src/config.ts
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;
  1. Set Firebase Config in .env

.env
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
  1. Change AuthProvider

src/store/ProviderWrapper.jsx
// Replace at line 27
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change auth Hooks

    1. Comment another context in the following file and uncomment the Firebase one.

src\hooks\useAuth.js
import AuthContext from 'contexts/FirebaseContext';
  1. Change Auth Login Method

src/config.js
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;

At present, firebase uses you need to set a secret in the following file. For more detail refer to Firebase here:

At present, firebase uses you need to set a secret in the following file. For more detail refer to Firebase here:

https://firebase.google.com/docs/reference/rest/auth
https://firebase.google.com/docs/reference/rest/auth
https://firebase.google.com/docs/reference/rest/auth
https://firebase.google.com/docs/reference/rest/auth