/r/Firebase

Photograph via snooOG

Community supported discussions on Google's Firebase platform.

/r/Firebase

30,700 Subscribers

1

FirebaseUI-android still maintained?

https://github.com/firebase/FirebaseUI-android has not been updated in years.
Now I get this message in Google Play Console:
You're utilizing legacy Google Sign-in APIs, which are deprecated and planned to be removed in 2025. For details on migrating to Sign in with Google via Credential Manager, read our migration guide.

https://developer.android.com/identity/sign-in/legacy-gsi-migration

1 Comment
2024/12/20
08:36 UTC

1

Images are taking almost 2 seconds to load from firebase

https://preview.redd.it/5powanglbx7e1.png?width=637&format=png&auto=webp&s=8f98a31f6df1d0bcf2c68ee766fa2f721f91d545

So as you can see, my images are taking almost 2 seconds to load, the file size shows as 15 Bytes but why is it taking almost 2 seconds to load?

Am i doing something wrong here ? I am storing the images in firebase storage and the url in the firestore db.

Some images are WEBp some are jpeg, and no even some webp take almost 2 seconds.

I even tried with a hard reload.

Most of the time is spent on waiting for server to respond. Anything i can do to reduce this?

https://preview.redd.it/ir6b18nobx7e1.png?width=703&format=png&auto=webp&s=9e6b30822994931144b5ae90fb5356ed11c0f44c

11 Comments
2024/12/20
03:35 UTC

6

Firebase Dynamic Links Deprecation - How Are You Handling the Migration? [Discussion]

Hey Firebase community 👋

As we all know, Firebase Dynamic Links is shutting down in August 2025. This affects a lot of us, and I'm curious about how everyone is planning to handle this transition.

Some key questions:
- What's your current usage of Dynamic Links?
- Have you started planning the migration?
- What alternatives are you considering?
- What features are most critical for your use case?

Our team has been heavily impacted by this too.

That is why we're building LinkFlow as a drop-in replacement. We're focusing on making the migration as painless as possible while adding some improvements like unlimited link generation and better analytics. Join the waitlist now and let us know what you think!

Let's discuss and share insights to help everyone prepare for this transition.

1 Comment
2024/12/19
22:24 UTC

3

Is firebase data connect worth it?

I feel that ultimately, with the app I'm building, with any traction I will have to switch to a relational DB. Since it's similar to a social media app in needs. I chose Firestore since I was in my first year of coding in general and have been working on this project ever since. Honestly, it meets my needs, but does make things more complicated and expensive for sure.

So would migrating my data to data connect and building there be worth it? Is it really like a PostgreSQL DB or is there some Firebase changes to the structure. Since, let's say everything goes beyond amazing, and I want to move to AWS or my own server.

Thanks!

4 Comments
2024/12/19
17:26 UTC

1

is there any way to get token generated by Firebase messaging on website without push notification allow ?

I have mobile app and website both use firebase messaging getToken method to get device token to identify device and browser along with UDID generated as device ID. My logic is I am generating token before login to my website because for my login device ID and device token ( generated by firebase messaging ) need for security purpose. Same work in mobile apps because there irrespective of permission but website it throw error An error occurred while retrieving token.  FirebaseError: Messaging: The notification permission was not granted and blocked instead. (messaging/permission-blocked)

is there any way to get this issue resolved ? because I need similar token.

2 Comments
2024/12/19
13:49 UTC

2

Are paragraphs in strings possible?

Hello guys, I am new to this sub and to firebase. As a study project, I created a Firestore Database and added some products. Now I want to add the descriptions of the products, but I am not able to format the content in the string as I want to. Is there any way to add like paragraphs oder hyphens, so I don’t get a flowing text in the UI?

I guess this looks very trivial to you guys, but it would help me a lot.

4 Comments
2024/12/19
12:59 UTC

1

Any help on using bit bucket and not Github with firebase app hosting( the one in preview )?

I want this for an SSR base web application and want to try firebase app hosting. Sadly, I don't see any support for bit bucket from firebase. Now how do i go about this?

2 Comments
2024/12/19
11:33 UTC

1

pnpm monorepo function deployment

Hey,

I’m working on a project that is moving a few repos into a monorepo setup using pnpm. One of the repos is a simple Firebase function which is now moved from its own repo into the monorepo under root/packages/myfunction directory including the function code package.json and .firebaserc and firebase.json files.

In the root of the monorepo is my pnpm-lock.yaml after installing dependencies for all my packages which im a bit stuck with, my understanding is that for my dependencies to be fixed to consistent versions on deployments the lock file needs to be present to be respected during installation on build and deploy, however because the CLI is pushing up the code from root/packages/myfunction, it misses the pnpm lock file?

I can deploy fine with the structure like this, but when I look at the function source files in GCP I can see the package.json but no lock file.

Am I supposed to just add a pre deploy script in to copy the lock file across from the root and into the into the function package?

I’m wondering if I’m missing something here, or if anyone has some pointers of what I might be doing wrong with this setup.

0 Comments
2024/12/19
10:04 UTC

1

Google signin help

I'm brand new to firebase but it's been pretty self explanatory using it. For my new website project, I've added a Google and Github login for the site. I set github up and had it working immediately and flawless but I've been having trouble with Google. I've tried searching the web and even used AI to help fix it, which usually does the trick but I can't seem to get anything to work.

When I go to Authentication and sign in methods, I enable Google but I can't edit the credentials, so I just create it and it puts random credentials in there. I go back into Google signin to edit and when I go to save, it gives me an error and says it can't save. I've tried logging out, deleting cache, refreshing and a ton of other things I could think of.

Do I need to just create a new project and try it again? Has anyone ran into this problem? Is it simple and I'm just over looking it? Thank you in advance. Usually I figure it out but I can't even find a help article for this problem.

0 Comments
2024/12/19
09:14 UTC

0

Firebase pricing confused

I want to build a social media app with firebase. On the pricing website it has a free option and a paid option. Is the free one good for me to upload the app to the App Store or do most people use the paid version. What is the difference because I am confused. Is th free one enough for me and if I have ro pay how much because I’m confused wen I look at the website, here it is:

https://firebase.google.com/pricing

6 Comments
2024/12/19
03:41 UTC

6

Are wildcards now supported for subdomains?

https://preview.redd.it/rrlvklb83p7e1.png?width=721&format=png&auto=webp&s=4d9f9a9cc960483125fc59231c67516fe8cc8662

According to this Firebase blog post, wildcard subdomains are now supported on Firebase. However, when I try to add a custom domain with a wildcard, the platform doesn’t seem to allow it. Am I missing a step or misunderstanding how this feature works?

6 Comments
2024/12/18
23:53 UTC

2

How to build a for you page like TikTok with firebase

How would one build a for you page. I’m most concerned about not repeating posts again and again that the user already saw. Thanks!

5 Comments
2024/12/18
22:28 UTC

2

Having issues in vercel deployment

Hello, I am new to firebase. Basically it works, only on the deployment have a problem, seems like it cannot read the DatabaseURL.

https://preview.redd.it/mkxt0y7ztn7e1.png?width=2500&format=png&auto=webp&s=ee8529479ad71cefdb0aa8bedb72ebf7fad028d9

1 Comment
2024/12/18
19:40 UTC

2

Having issues with installing firebase admin with Vue

Hello everyone, Im having troubles importing/installing firebase admin. setting up firebase itself without the admin package works completely fine though. Every time I try installing firebase-admin my whole Vue application crashes an shows a "TypeError: Cannot read properties of undefined (reading 'from')". Any suggestions? im completely lost

thanks in advance

11 Comments
2024/12/18
11:39 UTC

2

Do I need to use firebase-admin in cloud functions?

I am reading some potentially sensitive data in a cloud function. Do I need to use the firebase-admin sdk?

5 Comments
2024/12/18
01:21 UTC

1

Auth - someone was able to make an email/password account AND a google sign in account, same email

Is this normal?? We tie user data to Firebase UID, and apparently a user of ours signed up via email/password AND logged in via google sign in. This created two separate UIDs, and then allowed them to sign up to two separate trials, which was not their intent obviously.

Is there a way to stop this from occurring??

3 Comments
2024/12/17
23:34 UTC

0

firebase/init.json 404 - While using signInWithPopup for Google Login

firebase/init.json shows 404 - While using signInWithPopup for Google Login . I am using authdomain with `firebaseapp.com` itself.

"use client";
import { Container, Button, Typography, Box, CircularProgress } from '@mui/material';
import { initializeApp } from "firebase/app";
import { getAuth, getRedirectResult, GoogleAuthProvider, signInWithCredential, signInWithPopup, signInWithRedirect } from "firebase/auth";
import axios from "./utils/axiosInstance";
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation'

export default function Login() {
    const [inprogress, setInProgress] = useState(false);
    const [loginResponse, setLoginResponse] = useState<any | null>(null);

    const router = useRouter()

    const firebaseConfig = {
        apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxx",
        authDomain: "xxxxxx.firebaseapp.com",
        projectId: "xxxxxx",
        storageBucket: "xxxxx.firebasestorage.app",
        messagingSenderId: "xxxxxx",
        appId: "xxxxxxxxxxx",
        measurementId: "xxxxxx"
      };

    const app = initializeApp(firebaseConfig);
    const auth = getAuth(app);

    getRedirectResult(auth).then((data)=>{
        console.log(data)
    })

    const signInWithGoogle = async () => {
        try {
            setInProgress(true)
            const provider = new GoogleAuthProvider();
            await signInWithRedirect(auth, provider);
        } catch (error) {
        }
    };

    return (
        <Container maxWidth="xs">
            ...
        </Container>
    );
}
3 Comments
2024/12/17
14:30 UTC

1

Firestore rules failing on "create" after making changes to "update" logic

I have a collection that contains fairly complicated documents. I'm trying to validate reads and writes to the collection using firestore security rules.

My match statements look like this:

    match /taxis/{taxiId} {
      allow read, delete: if request.auth.uid == existingDataField('userId');
      allow update: if request.auth.uid == existingDataField('userId');
      allow create: if taxiIsValidForCreate();
    }

The "taxiIsValidForCreate" function validates document creation. It's got a lot of logic in it so it's very close to the 1000 expressions limit (that limit is exasperating but that's a story for another post!).

In the format shown above reads, deletes, updates and creates all work. However, when I make changes to the "allow update" logic in order to make that a bit more complicated I get the dreaded "1000 expressions limit" error when trying to do a "create".

This is the error message:

PERMISSION_DENIED:
false for 'create' @ L503, Unable to evaluate the expression as the maximum of 1000 expressions to evaluate has been reached. for 'create' @ L536, false for 'update' @ L503, evaluation error at L535:24 for 'update' @ L535, false for 'update' @ L503, false for 'update' @ L535

Why is amending "allow update" logic having an effect on "create" behavior? Surely it shouldn't be evaluating anything in the "update" logic if the action is "create" and so any logic in the "allow update" section should be irrelevant.

Can anyone tell me if I'm missing something or if there's a way around this problem other than reducing the complexity of the create validation?

Many thanks

8 Comments
2024/12/17
14:17 UTC

1

Will vector search ever come to mobile development

I thought we could do vector search with firebase, KNN, but I guess you can't do so for an IOS app. Does anyone know if it will be coming soon or if there is another way to do that in a query? Would data connect have it?

1 Comment
2024/12/17
03:09 UTC

1

DataConnect: How do I define an index in graphql schema?

I've got something that looks like this:

type Experience @table(key: ["id") {
   ...
   user: User! @ref
   createdAt: Timestamp!
}

I would like to create an index on (userId, createdAt) but I don't see anything the docs about making custom indexes? I've already modified the backing SQL instance to have the indexes, but now, if I kick off a firebase deploy, it will try and delete the index.. Any ideas here?

2 Comments
2024/12/17
01:32 UTC

4

Looking for a free tier way to manage user generated images in the cloud.

I am making a tinder clone as a first project and I am having trouble finding the best way to handle images without upgrading to the blaze plan. I was wondering what my options are.

6 Comments
2024/12/16
21:16 UTC

0

14 Comments
2024/12/16
11:47 UTC

5

Best way to optimize Real Time Database for real time updates?

I currently have a project being developed using RTD and I am looking for advice.

The project is to improve the efficiency of my manufacturing facility. We want management to upload data to Webpage 1. That data is stored in the RTD and then Webpage 2 receives the data.

It will be used to show the production schedule for the current day. We pull data from the RTD every minute so if management makes changes, they are automatically shown on the screen.

This is an overview of the current structure:
https://imgur.com/a/QnXnE5Q

My database structure includes nested nodes with unique IDs. Example:

Shop Floor:
-NQ5X8TyWuBZp3cL7A9Df
Date: "2024-12-10"
Product: "Product A"
Build time: "2 hours"
StartTime: "10:00"
EndTime: "12:00"

Current Problem: We are using a lot of data because we are getting the data so often.

Question:

- What is the best way to set up my database to support efficient querying and real-time updates
- How can I only update the data when changes are made? Instead of pulling all the data every minute.

Thank you!

12 Comments
2024/12/15
22:17 UTC

1

Not importing User class from firebase/auth on Next.js

I'm getting this error when I try to run a game store website that I'm making for a school project using Next.js:

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./app/page.js:7:1
Module not found: Can't resolve './firebase/auth'
   5 | import { auth, db } from '@/app/lib/firebase/clientApp'
   6 | import { doc, getDoc, setDoc } from "firebase/firestore"
>  7 | import { User } from './firebase/auth';
     | ^
   8 |
   9 | const Home = () => {
  10 |   const [loading, setLoading] = useState(true);

I'm on the conclusion that maybe I'm importing it wrong but it could also be the fact that we're using javascript instead of typescript? Here's the full code of the page for reference:

'use client'
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { onAuthStateChanged } from 'firebase/auth';
import { auth, db } from '@/app/lib/firebase/clientApp'
import { doc, getDoc, setDoc } from "firebase/firestore"
import { User } from './firebase/auth';

const Home = () => {
  const [loading, setLoading] = useState(true);
  const [user, setUser] = useState<User|null>(null);
  const router = useRouter();

  useEffect(() => {
    const unsubscribe = onAuthStateChanged(auth, async (user) => {
      if (user) {
        if (user.emailVerified) {
          const userDoc = await getDoc(doc(db, "Users", user.uid));
          if (!userDoc.exists()) {
            const registrationData = localStorage.getItem('registrationData')
            const {
              firstName = '',
              lastName = '',
              middleName = '',
            } = registrationData ? JSON.parse(registrationData) : {};

            await setDoc(doc(db, "Users", user.uid), {
              firstName,
              lastName,
              middleName,
              email: user.email,
            })

            localStorage.removeItem('registrationData');
          }
          setUser(user);
          router.push('/pages/dashboard')
        } else {
          setUser(null);
          router.push('/pages/home')
        }
      } else {
        setUser(null);
        router.push('/pages/home')
      }
      setLoading(false)
    }
    )
    return () =>
      unsubscribe()

  }, [router]);
  if (loading) {
    return <p>Loading</p>
  }
  return (
    <div>
      {user ? "Redirecting to dashboard..." : "Redirecting to home page..."}
    </div>
  )
}

export default Home;

EDIT: After fiddling around a bit, it's still not importing but I'm getting a different error which is Attempted import error: 'User' is not exported from 'firebase/auth' (imported as 'User').Also, when I hover over the User import, it shows that it is an interface User class. I'm assuming that it does recognize the import but the fact that I'm importing from a TypeScript class might be the issue?

1 Comment
2024/12/15
14:35 UTC

16

No way I can't set a spending limit???

I googled and people are saying that it doesn't exist??? How is that possible?

So if I make an error or get hacked, I can own Firebase thousands of dollars? Basically my life can get ruined if this happens.

I always though Googles product were safe but not having a spending limit is nuts! Or am I missing something? I'm a beginner so maybe I just don't understand

27 Comments
2024/12/15
14:27 UTC

1

Voicy - A Modern Voice Notes Application! 🎤

https://preview.redd.it/12j4rcspnz6e1.png?width=1316&format=png&auto=webp&s=b9c11e143d9c749e440fe04fcde32b4523a418ad

🎉 Excited to share my latest project...

Voicy transforms the way you capture and organize your thoughts through voice.

Built with cutting-edge tech, it offers:

✨ Key Features:

• Voice-to-text transcription

• Gemini-powered summaries of your recordings

• Smart organization with tags and categories

• Email-based secure authentication

🛠️ Tech Stack:

• Next.js + TypeScript

• Tailwind CSS with shadcn/ui

• Firebase (Auth, Storage, Functions, Firestore)

• Cloud Firestore

• Zustand for state management

• Gemini API for transcription

• Gemini API for summarization

🔥 What makes it special:

• Shortcut access - 'R' to start/stop recording

• Automatic transcription and summarization

• Beautiful, responsive UI that works everywhere

• Efficient data caching for better performance

Try it out: https://cloud-firestore-cache-web-demo.vercel.app/

#WebDevelopment #JavaScript #Firebase #NextJS #AI #ProductivityTools #SideProject

Would love to hear your thoughts and feedback! 🙌

Email me at jeet.dhandha.2511@gmail.com for any queries or feedback.

0 Comments
2024/12/15
10:23 UTC

3

Sudden spike in Cloud Storage usage

My project has only 288 MB stored but between December 12-13 there was 43.5 GB worth of data sent.

This project is for a small local business that normally doesn't get that much traffic. It normally averages only 1.2 GB sent a day.

How can I better track down what's going on?

https://preview.redd.it/yj2kipu1nw6e1.png?width=2544&format=png&auto=webp&s=4f5a82de4f946d6329b31aa3f9e111cfbf496b3f

3 Comments
2024/12/15
00:15 UTC

1

Firestore Transactions

0 Comments
2024/12/13
23:58 UTC

3

LLM as a service

I don't want to set up a server and want to put the API key directly in the frontend. Therefore, I am looking for a solution to limit the access with that API key. Just like Firebase actually does with Firebase Functions and Firebase Firestore.

Is there anything like this at the moment?

10 Comments
2024/12/13
21:59 UTC

Back To Top