Skip to content
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

Firebase Crashlytics - Cannot use dynamic params for declaring appId #1597

Open
BenjaminBihr opened this issue Aug 20, 2024 · 2 comments
Open

Comments

@BenjaminBihr
Copy link

BenjaminBihr commented Aug 20, 2024

Related issues

I couldn't find any related issues.

Version info

node: 20

firebase-functions: 5.0.0

firebase-tools: 13.15.2

Test case

import {defineString} from "firebase-functions/params";
import {onVelocityAlertPublished} from "firebase-functions/v2/alerts/crashlytics";
import {logger} from "firebase-functions";

const APP_ID = defineString('APP_ID');

export const detectVelocityAlert = onVelocityAlertPublished({
  appId: APP_ID,
}, async (event) => {
  logger.log("New velocity alert spotted!");
});

Steps to reproduce

  1. Create a Cloud Function using onVelocityAlertPublished.
  2. Define the appId using defineString('APP_ID') from firebase-functions/params.
  3. Attempt to deploy or run the function.

Expected behavior

I expect the function to accept a parameter defined via defineString('APP_ID') for the appId in the onVelocityAlertPublished function configuration.

Actual behavior

When I try to use defineString('APP_ID') to set the appId, the function fails to deploy because it appears to only accept a string literal, not a StringParams.

Were you able to successfully deploy your functions?

No, the deployment fails.

@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@exaby73
Copy link
Contributor

exaby73 commented Aug 29, 2024

Hello @BenjaminBihr. Thanks for bringing this up. Seems a valid feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants