Skip to content

feat(firestore): add databaseId configuration option#966

Merged
robingenz merged 4 commits intomainfrom
feat/issue-661
Mar 30, 2026
Merged

feat(firestore): add databaseId configuration option#966
robingenz merged 4 commits intomainfrom
feat/issue-661

Conversation

@robingenz
Copy link
Copy Markdown
Member

Summary

  • Add databaseId plugin configuration option to support non-default Firestore databases
  • Add FirebaseFirestoreConfig class/struct on Android and iOS following the existing convention
  • Only available for Android and iOS

Close #661

Copilot AI review requested due to automatic review settings March 30, 2026 15:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a databaseId plugin configuration option to allow selecting a non-default Firestore database instance on native platforms (Android/iOS), aligning the plugin with Firestore multi-database use cases described in #661.

Changes:

  • Extend Capacitor plugin config typings to include FirebaseFirestore.databaseId.
  • Introduce platform-specific FirebaseFirestoreConfig containers and pass config into the native implementations.
  • Route iOS/Android Firestore access through a helper that selects the default vs configured database instance.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/firestore/src/definitions.ts Adds Capacitor CLI config typings for FirebaseFirestore.databaseId.
packages/firestore/ios/Plugin/FirebaseFirestorePlugin.swift Builds and passes a FirebaseFirestoreConfig from Capacitor config into the implementation.
packages/firestore/ios/Plugin/FirebaseFirestoreConfig.swift New config struct holding databaseId.
packages/firestore/ios/Plugin/FirebaseFirestore.swift Uses a helper to pick the Firestore instance based on databaseId for all operations.
packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestorePlugin.java Reads config and passes it into the Android implementation.
packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestoreConfig.java New config class holding databaseId.
packages/firestore/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/firestore/FirebaseFirestore.java Selects Firestore instance based on databaseId.
.changeset/bright-foxes-dance.md Adds a changeset entry for the new configuration option.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 30, 2026

Open in StackBlitz

@capacitor-firebase/analytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/analytics@966

@capacitor-firebase/app

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app@966

@capacitor-firebase/app-check

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app-check@966

@capacitor-firebase/authentication

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/authentication@966

@capacitor-firebase/crashlytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/crashlytics@966

@capacitor-firebase/firestore

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/firestore@966

@capacitor-firebase/functions

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/functions@966

@capacitor-firebase/messaging

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/messaging@966

@capacitor-firebase/performance

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/performance@966

@capacitor-firebase/remote-config

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/remote-config@966

@capacitor-firebase/storage

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/storage@966

commit: 370ff9b

@robingenz robingenz merged commit 78c174d into main Mar 30, 2026
6 checks passed
@robingenz robingenz deleted the feat/issue-661 branch March 30, 2026 16:22
@github-actions github-actions bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(firestore): support non-default databases

2 participants