Skip to content

fix: Support json format in Firebase options for web for firebase CLI >=13.31.0 #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

yorifuji
Copy link
Contributor

@yorifuji yorifuji commented Feb 14, 2025

Description

Updated to support the new output format of apps:sdkconfig command introduced in Firebase CLI v13.31.0, which changed from JavaScript to JSON format for web apps.

Old format (before Firebase CLI v13.31.0):

firebase.initializeApp({
  "projectId": "my-project",
  "appId": "1:1234567890:web:abcdef1234567890",
  "apiKey": "api-key",
  "authDomain": "my-project.firebaseapp.com",
  "messagingSenderId": "1234567890",
  "measurementId": "G-ABCDEF1234"
});

New format (Firebase CLI v13.31.0 and later):

{
  "projectId": "my-project",
  "appId": "1:1234567890:web:abcdef1234567890",
  "apiKey": "api-key",
  "authDomain": "my-project.firebaseapp.com",
  "messagingSenderId": "1234567890",
  "measurementId": "G-ABCDEF1234"
}

Updated convertConfigToOptions to handle both formats and added unit tests.

Related issue

fixes #372

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Feb 14, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the Needs Attention OP created or responded to issue and it needs attention. label Feb 14, 2025
@yorifuji yorifuji marked this pull request as ready for review February 14, 2025 09:25
@russellwheatley russellwheatley changed the title fix: Support json format in Firebase options for web fix: Support json format in Firebase options for web for firebase CLI >13.3.0 Feb 18, 2025
@russellwheatley russellwheatley changed the title fix: Support json format in Firebase options for web for firebase CLI >13.3.0 fix: Support json format in Firebase options for web for firebase CLI >=13.31.0 Feb 18, 2025
@russellwheatley
Copy link
Member

@yorifuji - thank you for the effort. LGTM 🚀

@russellwheatley russellwheatley merged commit 581e7c4 into invertase:main Feb 18, 2025
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention OP created or responded to issue and it needs attention.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: type 'Null' is not a subtype of type 'String' in type cast
3 participants