Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's New in Firebase 2023

What's New in Firebase 2023

Learn the latest features, hidden gems, and exciting updates in Firebase.

Firebase Thailand

April 01, 2023
Tweet

More Decks by Firebase Thailand

Other Decks in Technology

Transcript

  1. What’s new in Firebase Google Developer Expert in Firebase Jirawat

    Karanwittayakarn Firebase Dev Day 2023 GDG Bangkok Firebase Thailand Organized by
  2. #FirebaseDevDay2023 COUNT() aggregation const collectionRef = db.collection('cities'); const query =

    collectionRef.where('state', '==', 'CA'); const snapshot = await query.count().get(); console.log(snapshot.data().count);
  3. #FirebaseDevDay2023 Removing hard limits 1.No maximum reads per second. 2.No

    maximum writes per second. 3.No maximum concurrent, real-time, connections Cloud Firestore
  4. #FirebaseDevDay2023 Projects Document project_id: 111 user: “sparky”, status: “not_started” Document

    project_id: 222 user: “amy”, status: “complete” Document project_id: 333 user: “bob”, status: “complete” Document project_id: 444 user: “alice”, status: “dropped” Document project_id: 111 user: “sparky”, status: “in_progress” Document project_id: 444 user: “alice”, status: “dropped” const q = query(projectsRef, or(where('user', '==', 'sparky'), where('status', '!=', 'complete') ) );
  5. #FirebaseDevDay2023 Combination of OR and AND operations const q =

    query(collection(db, "cities"), and( where('state', '==', 'CA'), or( where('capital', '==', true), where('population', '>=', 1000000) ) ));
  6. #FirebaseDevDay2023 Blocking Functions import {identity} from "firebase-functions/v2"; export const blockauth

    = identity.beforeUserCreated((event) => { const email = event?.data?.email || ""; // Ensure only google.com emails can log into the changelog app if (!(email.includes("@google.com"))) { throw new identity.HttpsError( "permission-denied", "Only @google.com are allowed to register."); } });
  7. #FirebaseDevDay2023 service firebase.storage { match /b/{bucket}/o { match releases/{releaseId}/file/{fileId} {

    // Release authors can create, update, and delete files // Universally readable allow read: if true; } } } allow write: if firestore.get(/databases/(default)/documents/releases/$(releaseId)). data.author.uid == request.auth.uid;
  8. Manage Marketing with Mailchimp Run Subscription Payments with Stripe Search

    with Algolia Resize Images Translate Text Trigger Email Export Collections to BigQuery Shorten URLs Distributed Counter Delete User Data Send Messages with MessageBird Send Messages with Twilio Make Payments with Google Pay Snapchat Sticker Generator Search Firestore with Typesense Enable In-App Purchases with RevenueCat Authenticate with Stream Feeds Track Shipping Labels with ShipEngine Analyze Toxicity with Perspective API Search with Elastic App Search
  9. #FirebaseDevDay2023 Firebase Remote Config Today Fetch API Device asks the

    server for a new config Real-time Listener API Server tells a device there is a new config
  10. #FirebaseDevDay2023 Listen for updates in real-time remoteConfig.addOnConfigUpdateListener(object : ConfigUpdateListener {

    override fun onUpdate(configUpdate : ConfigUpdate) { if (configUpdate.updatedKeys.contains("welcome_message")) { remoteConfig.activate().addOnCompleteListener { displayWelcomeMessage() } } } override fun onError(error : FirebaseRemoteConfigException) { Log.w(TAG, "Config update error with code: " + error.code, error) } })