Slide 1

Slide 1 text

Supercharge your app Supercharge your app with Firebase and Stream with Firebase and Stream

Slide 2

Slide 2 text

Peter Friese Peter Friese Stefan Blos Stefan Blos Developer Advocate, Firebase Developer Advocate, Firebase Developer Advocate, Stream Developer Advocate, Stream @pete rf riese @pete rf riese @stefanjblos @stefanjblos

Slide 3

Slide 3 text

Side business / Moonlighting

Slide 4

Slide 4 text

Side business / Moonlighting

Slide 5

Slide 5 text

Firebase Backend Cloud Storage Cloud Firestore Tech Stack Authentication Client

Slide 6

Slide 6 text

New Features

Slide 7

Slide 7 text

Challenge Basically, I’m very smol

Slide 8

Slide 8 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client Chat Backend ? Chat UI +

Slide 9

Slide 9 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client Chat Backend Stream Stream UI +

Slide 10

Slide 10 text

UI Components 􀟜 Stream Overview Infrastructure Authentication 􀎥 • UIKit • Swi ft UI • JWT • BYOS* * Bring Your Own Server • Managed service

Slide 11

Slide 11 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client Chat Backend A miracle happens here ? Stream Stream UI +

Slide 12

Slide 12 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client https://getstream.io/blog/ vapor-swift-stream-server/ ? Custom Backend Vapor Chat Backend Stream Stream UI +

Slide 13

Slide 13 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client ? Chat Backend Stream Stream UI +

Slide 14

Slide 14 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client Cloud Functions Stream UI + Chat Backend Stream

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Serverless JavaScript / TypeScript Automatic scaling Run in trusted environment

Slide 17

Slide 17 text

But… Basically, I’m very smol

Slide 18

Slide 18 text

Firebase Backend Cloud Storage Cloud Firestore Updated tech stack Authentication Client Cloud Functions Extensions Chat Backend Stream Stream UI +

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Pre-built packages of functionality One-click install to Firebase project Con fi gurable

Slide 21

Slide 21 text

Live Demo - Chat

Slide 22

Slide 22 text

Live Demo - Chat Install Firebase Extension Implement token exchange Connect the UI

Slide 23

Slide 23 text

Install Firebase Extension Implement token exchange Connect the UI 􀆅 Live Demo - Chat

Slide 24

Slide 24 text

Install Firebase Extension Implement token exchange Connect the UI 􀆅 􀆅 Live Demo - Chat

Slide 25

Slide 25 text

Install Firebase Extension Implement token exchange Connect the UI 􀆅 􀆅 􀆅 Live Demo - Chat

Slide 26

Slide 26 text

New Features

Slide 27

Slide 27 text

Live Demo - Email

Slide 28

Slide 28 text

Live Demo - Email Install Firebase Extension Trigger sending email (via Firestore) Add UI to send the email

Slide 29

Slide 29 text

Live Demo - Email Install Firebase Extension Trigger sending email (via Firestore) Add UI to send the email 􀆅

Slide 30

Slide 30 text

Live Demo - Email Install Firebase Extension Trigger sending email (via Firestore) Add UI to send the email 􀆅 􀆅

Slide 31

Slide 31 text

Live Demo - Email Install Firebase Extension Trigger sending email (via Firestore) Add UI to send the email 􀆅 􀆅 􀆅

Slide 32

Slide 32 text

New Features

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

One more thing… One more thing…

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Building an Extension Install Firebase tools (CLI) Write Cloud Functions (triggers) Package Extension

Slide 39

Slide 39 text

name: auth-chat version: 0.2.0 specVersion: v1beta displayName: Authenticate with Stream Chat description: Synchronizes Firebase Authentication users with Stream, and creates and revoke Stream Chat authentication tokens. license: Apache-2.0 author: authorName: Stream url: https: / / getstream.io/ sourceUrl: https: // github.com/GetStream/stream-firebase-extensions/tree/ main/auth-chat billingRequired: true params: - param: LOCATION label: Cloud Functions location description: >- Where do you want to deploy the functions created for this extension? type: select extension.yaml

Slide 40

Slide 40 text

import * as admin from "firebase-admin"; import * as functions from "firebase-functions"; import { StreamChat } from "stream-chat"; admin.initializeApp(); const serverClient = StreamChat.getInstance( process.env.STREAM_API_KEY!, process.env.STREAM_API_SECRET!, ); // When a user is created in Firebase an associated Stream account is also created. export const createStreamUser = functions.auth.user().onCreate(async (user) => { functions.logger.log("Firebase user created", user); / / Create user using the serverClient. const response = await serverClient.upsertUser({ id: user.uid, name: user.displayName, email: user.email, image: user.photoURL, }); index.ts

Slide 41

Slide 41 text

import * as functions from "firebase-functions"; import { StreamChat } from "stream-chat"; admin.initializeApp(); const serverClient = StreamChat.getInstance( process.env.STREAM_API_KEY!, process.env.STREAM_API_SECRET!, ); // When a user is created in Firebase an associated Stream account is also created. export const createStreamUser = functions.auth.user().onCreate(async (user) => { functions.logger.log("Firebase user created", user); / / Create user using the serverClient. const response = await serverClient.upsertUser({ id: user.uid, name: user.displayName, email: user.email, image: user.photoURL, }); functions.logger.log("Stream user created", response); return response; }); index.ts

Slide 42

Slide 42 text

Wrapping up

Slide 43

Slide 43 text

New Features

Slide 44

Slide 44 text

Firebase Backend Cloud Storage Cloud Firestore Tech Stack - Before Authentication Client

Slide 45

Slide 45 text

Firebase Backend Cloud Storage Cloud Firestore Authentication Client Extensions Chat Backend Stream Stream UI + Tech Stack - A ft er

Slide 46

Slide 46 text

Thanks Thanks @pete rf riese @pete rf riese @stefanjblos @stefanjblos Thanks