Skip to content

Commit

Permalink
refactor: remove deprecated serviceAccount
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removed deprecated `admin.serviceAccount` option. Refer
to the previous version for migration instructions.
  • Loading branch information
posva committed Oct 2, 2023
1 parent 53af0a7 commit 4144bd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({

// This one is set by servers, we set the GOOGLE_APPLICATION_CREDENTIALS env variable instead that has a lower priority and can be both a path or a JSON string
// process.env.FIREBASE_CONFIG ||= JSON.stringify(options.config)
// FIXME: remove deprecation in next release
if (typeof options.admin?.serviceAccount === 'string') {
process.env.GOOGLE_APPLICATION_CREDENTIALS ||=
options.admin.serviceAccount
}
const hasServiceAccount =
typeof process.env.GOOGLE_APPLICATION_CREDENTIALS === 'string' &&
process.env.GOOGLE_APPLICATION_CREDENTIALS.length > 0
Expand Down
9 changes: 1 addition & 8 deletions packages/nuxt/src/module/options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FirebaseOptions } from 'firebase/app'
import type { AppOptions, ServiceAccount } from 'firebase-admin'
import type { AppOptions } from 'firebase-admin'
import type { NuxtVueFireAppCheckOptions } from '../runtime/app-check'

export interface VueFireNuxtModuleOptions {
Expand All @@ -23,13 +23,6 @@ export interface VueFireNuxtModuleOptions {
* Firebase Admin Options passed to `firebase-admin`'s `initializeApp()`.
*/
options?: Omit<AppOptions, 'credential'>

/**
* Firebase Admin Service Account passed to `firebase-admin`'s `initializeApp()`. Required if you are adding an
* adminConfig.
* @deprecated use GOOGLE_APPLICATION_CREDENTIALS env variable instead with the service-account JSON content
*/
serviceAccount?: string | ServiceAccount
}

/**
Expand Down

0 comments on commit 4144bd8

Please sign in to comment.