Firebase AuthのLocal EmulatorはAuthProviderに応じて適切なダミーユーザを生成してくれる
Firebase Local Emulator Suiteを使ってローカル開発を行う際に↓の設定をするとFirebase Authの接続先をエミュレータに変更できる。
firebase.auth().useEmulator('http://localhost:9099')
Google認証を使いたい場合に、エミュレータだとOAuth認証はどうなるんだろうと思って試してみたところダミーのOAuthユーザを生成してくれる仕組みになっていた。
↓でGoogleログイン用のポップアップを表示すると、既存のダミーユーザか新規ユーザを追加するかが選択できる。
const provider = new firebase.auth.GoogleAuthProvider()
await app.auth().signInWithPopup(provider)

新規ユーザの場合は「Auto-Generate」ボタンをクリックするとダミーデータをいい感じに入力してくれる。

ユーザ登録後にエミュレータUI(http://localhost:4000/auth
)でカスタムクレームを設定することもできる。

エミュレータがなかった頃は開発用のfirebaseプロジェクトを別途用意した上でfirebase admin sdkを使って都度ユーザのカスタムクレームを設定する必要があったので手間だった。
エミュレータのおかげでfirebaseを使ったサービスでもローカル開発がとてもやりやすくなった。